From 631730f2f224a4ff1d224bd567b33b441e94418a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 28 Jul 2024 16:07:22 +0800 Subject: [PATCH] Replace SWR with CacheFirst This SWR strategy is sometimes too stale, possibly a bug with Workbox --- public/sw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sw.js b/public/sw.js index cf945218..b1a95073 100644 --- a/public/sw.js +++ b/public/sw.js @@ -101,7 +101,7 @@ const apiIntermediateRoute = new RegExpRoute( // - trends/* // - timelines/link /^https?:\/\/[^\/]+\/api\/v\d+\/(trends|timelines\/link)/, - new StaleWhileRevalidate({ + new CacheFirst({ cacheName: 'api-intermediate', plugins: [ new ExpirationPlugin({