From f59058efa1ed4587845d59cb06b2d67ed5bfed6b Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 17 Sep 2024 17:16:12 +0800 Subject: [PATCH] Add more purges and don't cache too long --- public/sw.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/sw.js b/public/sw.js index b2ad5f54..9ab25518 100644 --- a/public/sw.js +++ b/public/sw.js @@ -45,7 +45,6 @@ const imageRoute = new Route( plugins: [ new ExpirationPlugin({ maxEntries: 50, - maxAgeSeconds: 3 * 24 * 60 * 60, // 3 days purgeOnQuotaError: true, }), new CacheableResponsePlugin({ @@ -88,6 +87,7 @@ const apiExtendedRoute = new RegExpRoute( plugins: [ new ExpirationPlugin({ maxAgeSeconds: 24 * 60 * 60, // 1 day + purgeOnQuotaError: true, }), new CacheableResponsePlugin({ statuses: [0, 200], @@ -129,6 +129,7 @@ const apiRoute = new RegExpRoute( plugins: [ new ExpirationPlugin({ maxAgeSeconds: 5 * 60, // 5 minutes + purgeOnQuotaError: true, }), new CacheableResponsePlugin({ statuses: [0, 200],