diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs index 5806e46..244b2bd 100644 --- a/frontend/next.config.mjs +++ b/frontend/next.config.mjs @@ -26,6 +26,16 @@ const nextConfig = { source: "/ui-manifest.json", headers: [{ key: "Cache-Control", value: "public, max-age=0, must-revalidate" }], }, + { + /* หน้าเว็บ (HTML) เป็น static prerender → Next แปะ s-maxage=31536000 (1 ปี) + ทำให้เบราว์เซอร์ค้างหน้าเก่าหลัง deploy ใหม่ จึงบังคับ no-store เฉพาะ text/html + (ไม่กระทบ _next/static ที่มี hash อยู่แล้ว) */ + source: "/:path*", + has: [{ type: "header", key: "accept", value: "(.*text/html.*)" }], + headers: [ + { key: "Cache-Control", value: "private, no-cache, no-store, max-age=0, must-revalidate" }, + ], + }, ]; }, async rewrites() { diff --git a/frontend/public/sw.js b/frontend/public/sw.js index 3ae6201..edbffc3 100644 --- a/frontend/public/sw.js +++ b/frontend/public/sw.js @@ -15,7 +15,7 @@ - SW ใหม่ → skipWaiting + clients.claim + แจ้งหน้าเว็บ ============================================================ */ -const VERSION = "2026.10.24.1"; /* bump เมื่อแก้ UI เพื่อบังคับให้ cache เก่าถูกทิ้ง */ +const VERSION = "2026.10.24.2"; /* bump เมื่อแก้ UI เพื่อบังคับให้ cache เก่าถูกทิ้ง */ const CACHE = `atroute-${VERSION}`; const OFFLINE_URL = "/offline.html"; const VERSION_URL = "/version.json"; diff --git a/frontend/public/version.json b/frontend/public/version.json index 449f5c1..88f3c99 100644 --- a/frontend/public/version.json +++ b/frontend/public/version.json @@ -1,6 +1,6 @@ { "app": "Atroute", - "version": "2026.10.24.1", - "builtAt": "2026-10-24T00:25:14", + "version": "2026.10.24.2", + "builtAt": "2026-10-24T00:33:20", "pwa": true }