From 5c5015883dad93fbb1a37f35e0cbc2d00b54f09f Mon Sep 17 00:00:00 2001 From: oliver Date: Wed, 15 Apr 2026 18:47:48 -0300 Subject: [PATCH] Fix caching --- todo.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/todo.html b/todo.html index bdc5c06..8868d2d 100644 --- a/todo.html +++ b/todo.html @@ -442,13 +442,15 @@ async function apiFetch(method, body) { const opts = { method, + cache: "no-store", headers: { "Content-Type": "application/json", ...authHeaders(), }, }; if (body !== undefined) opts.body = JSON.stringify(body); - const res = await fetch(API, opts); + const url = method === "GET" ? API + "?_t=" + Date.now() : API; + const res = await fetch(url, opts); if (res.status === 401 || res.status === 403) throw new Error("AUTH"); if (!res.ok) throw new Error("HTTP " + res.status);