fix(pwa): prevent immutable caching of /sw.js and bust SW registration to v5

This commit is contained in:
Amirul Islam Redwan71
2026-12-06 07:19:47 +06:00
parent 9a9021b9c8
commit 7db3f0e72d
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -37,6 +37,12 @@ server {
try_files /bimi-logo.svg =404;
}
# Service Worker must never be cached as immutable
location = /sw.js {
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
try_files /sw.js =404;
}
# Cache other static assets
location ~* \.(css|js|woff2?|ttf|svg|png|jpg|jpeg|ico|gif|webp)$ {
expires 7d;