fix: Implement Network-First SW strategy, no-cache headers in Nginx for index.html/sw.js, and auto 401 token cleanup to fix post-redeploy stale cache issues

This commit is contained in:
Richard
2026-07-31 11:23:49 +02:00
parent 2403f1313f
commit ac71b38823
7 changed files with 83 additions and 64 deletions
+3 -1
View File
@@ -19,7 +19,9 @@
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js').catch(err => console.log('SW reg error:', err));
navigator.serviceWorker.register('/sw.js').then(reg => {
reg.update();
}).catch(err => console.log('SW reg error:', err));
});
}
</script>