Skip to content

Commit 92f03ea

Browse files
committed
Fix service worker update notification by disabling cache for SW and index.html
1 parent 51a2e20 commit 92f03ea

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

cloud/deploy/nginx/blazor.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ server {
2525
application/xml application/xml+rss text/javascript application/wasm
2626
application/octet-stream;
2727

28+
# Service worker - must NOT be cached (enables update detection)
29+
location = /service-worker.js {
30+
expires -1;
31+
add_header Cache-Control "no-store, no-cache, must-revalidate";
32+
}
33+
34+
# index.html - should not be cached (SPA entry point)
35+
location = /index.html {
36+
expires -1;
37+
add_header Cache-Control "no-store, no-cache, must-revalidate";
38+
}
39+
2840
# Blazor framework files (long cache, immutable hashes)
2941
location /_framework/ {
3042
expires 1y;

0 commit comments

Comments
 (0)