From 087276fa90a171622a332c301c19f788ba24c21e Mon Sep 17 00:00:00 2001 From: araharah-executor Date: Sun, 25 Oct 2026 04:54:41 +0800 Subject: [PATCH] =?UTF-8?q?feat(07-04):=20the=20static-asset=20cache=20pol?= =?UTF-8?q?icy=20=E2=80=94=20hashed=20assets=20immutable,=20HTML=20entry?= =?UTF-8?q?=20revalidating=20(T-07-20,=20D-06)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - web/public/_headers: /assets/* → public, max-age=31556952, immutable (Vite content-hashed output) - / → public, max-age=0, must-revalidate (the HTML entry points at the current hashed assets) - no CORS/Set-Cookie/other rules — same-origin policy stays the app's design - verified: web/dist/_headers exists after the theme+web build --- web/public/_headers | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 web/public/_headers diff --git a/web/public/_headers b/web/public/_headers new file mode 100644 index 0000000..c9b8119 --- /dev/null +++ b/web/public/_headers @@ -0,0 +1,10 @@ +# Cloudflare Workers static-assets cache policy (07-04, D-06). +# Vite emits content-HASHED files under /assets/* — a hashed URL's bytes can +# never change, so they are immutable for a year. The HTML entry is NOT +# hashed (it points at the current hashed assets) — it must revalidate on +# every visit or a stale entry would point at deleted asset files. +/assets/* + Cache-Control: public, max-age=31556952, immutable + +/ + Cache-Control: public, max-age=0, must-revalidate