Skip to content

Commit 2dc1e07

Browse files
committed
⚗️(service-worker) remove index from cache first strategy
Some users reported that the app was giving a blank page, it seems to happens often after a release. It could be due to the fact that the service worker is caching the index.html file and not updating it properly after a new release. We remove the index from the cache first strategy to avoid this kind of issue. We set as well the default handler with the "StaleWhileRevalidate" strategy to force the cache to be updated in the background.
1 parent fbdeb90 commit 2dc1e07

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ and this project adheres to
1919
### Fixed
2020

2121
- 🐛(backend) duplicate sub docs as root for reader users
22+
- ⚗️(service-worker) remove index from cache first strategy #1395
2223
- 🐛(frontend) fix 404 page when reload 403 page #1402
24+
- 🐛(frontend) fix legacy role computation #1376
2325

2426
## [3.7.0] - 2025-09-12
2527

@@ -47,7 +49,6 @@ and this project adheres to
4749
### Fixed
4850

4951
- 🐛(frontend) fix callout emoji list #1366
50-
- 🐛(frontend) fix legacy role computation #1376
5152

5253
## [3.6.0] - 2025-09-04
5354

src/frontend/apps/impress/src/features/service-worker/service-worker.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
NetworkFirst,
1616
NetworkFirstOptions,
1717
NetworkOnly,
18+
StaleWhileRevalidate,
1819
StrategyOptions,
1920
} from 'workbox-strategies';
2021

@@ -104,8 +105,6 @@ const FALLBACK = {
104105
images: '/assets/img-not-found.svg',
105106
};
106107
const precacheResources = [
107-
'/',
108-
'/index.html',
109108
'/401/',
110109
'/404/',
111110
FALLBACK.offline,
@@ -255,7 +254,7 @@ registerRoute(
255254
* Cache all other files
256255
*/
257256
setDefaultHandler(
258-
getStrategy({
257+
new StaleWhileRevalidate({
259258
cacheName: getCacheNameVersion('default'),
260259
plugins: [
261260
new CacheableResponsePlugin({ statuses: [0, 200] }),

0 commit comments

Comments
 (0)