Don't send data if not modified
This commit is contained in:
1 parent
9935bc7f1f
commit
0f5d1b5221
5 files changed
+54
-2
No files matched your search
@@ -17,6 +17,19 @@
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta
|
||||
name="htmx-config"
|
||||
content='{
|
||||
"responseHandling":[
|
||||
{"code":"204", "swap": false},
|
||||
{"code":"304", "swap": false},
|
||||
{"code":"[23]..", "swap": true},
|
||||
{"code":"422", "swap": true},
|
||||
{"code":"[45]..", "swap": false, "error":true},
|
||||
{"code":"...", "swap": true}
|
||||
]
|
||||
}'
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
||||
@@ -10,11 +10,16 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% if lb_now.data and lb.data %}
|
||||
<div
|
||||
class="block"
|
||||
hx-get="/m/listenbrainz"
|
||||
hx-trigger="every 15s"
|
||||
hx-swap="outerHTML"
|
||||
hx-headers='{
|
||||
"If-Modified-Since": {{ (lb_now.last_updated, lb.last_updated) | max | int }},
|
||||
"If-None-Match": "{{ lb_etag() }}"
|
||||
}'
|
||||
>
|
||||
<h2><a href="https://listenbrainz.org/user/risdeveau/">Listenbrainz</a></h2>
|
||||
{% if lb_now.data and lb_now.data.listens.0 %}
|
||||
@@ -26,3 +31,4 @@
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -3,6 +3,10 @@
|
||||
hx-get="/m/steam"
|
||||
hx-trigger="every 1m"
|
||||
hx-swap="outerHTML"
|
||||
hx-headers='{
|
||||
"If-Modified-Since": {{ (recent.last_updated, owned.last_updated) | max | int }},
|
||||
"If-None-Match": "{{ steam_etag() }}"
|
||||
}'
|
||||
>
|
||||
<h2><a href="https://steamcommunity.com/id/risdeveau">Steam</a></h2>
|
||||
|
||||
|
||||
Reference in new issue
Block a user