Full document, spreadsheet, slideshow, and diagram tooling
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request 'fix: force service worker updates on every deploy' (#155) from fix/sw-force-update into main

scott b6bd84d3 5baca5be

+31 -3
+7
server/index.ts
··· 422 422 423 423 // Static files (production build) 424 424 const distPath = path.join(PROJECT_ROOT, 'dist'); 425 + 426 + // Service worker must never be cached by the browser — ensures updates propagate immediately 427 + app.get('/sw.js', (_req, res) => { 428 + res.set('Cache-Control', 'no-cache, no-store, must-revalidate'); 429 + res.sendFile(path.join(distPath, 'sw.js')); 430 + }); 431 + 425 432 app.use(express.static(distPath)); 426 433 427 434 // SPA fallback: serve the correct index.html for each sub-app
+8 -1
src/docs/index.html
··· 417 417 <script> 418 418 // Service Worker registration for offline support 419 419 if ('serviceWorker' in navigator) { 420 - navigator.serviceWorker.register('/sw.js').catch(function() {}); 420 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 421 + reg.addEventListener('updatefound', function() { 422 + var nw = reg.installing; 423 + if (nw) nw.addEventListener('statechange', function() { 424 + if (nw.state === 'activated') location.reload(); 425 + }); 426 + }); 427 + }).catch(function() {}); 421 428 } 422 429 </script> 423 430 <script>
+8 -1
src/index.html
··· 176 176 </script> 177 177 <script> 178 178 if ('serviceWorker' in navigator) { 179 - navigator.serviceWorker.register('/sw.js').catch(function() {}); 179 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 180 + reg.addEventListener('updatefound', function() { 181 + var nw = reg.installing; 182 + if (nw) nw.addEventListener('statechange', function() { 183 + if (nw.state === 'activated') location.reload(); 184 + }); 185 + }); 186 + }).catch(function() {}); 180 187 } 181 188 </script> 182 189 </body>
+8 -1
src/sheets/index.html
··· 361 361 </script> 362 362 <script> 363 363 if ('serviceWorker' in navigator) { 364 - navigator.serviceWorker.register('/sw.js').catch(function() {}); 364 + navigator.serviceWorker.register('/sw.js', { updateViaCache: 'none' }).then(function(reg) { 365 + reg.addEventListener('updatefound', function() { 366 + var nw = reg.installing; 367 + if (nw) nw.addEventListener('statechange', function() { 368 + if (nw.state === 'activated') location.reload(); 369 + }); 370 + }); 371 + }).catch(function() {}); 365 372 } 366 373 </script> 367 374 <div class="version-badge">v%APP_VERSION%</div>