From b7c1078c265941bee0c3b7a28bfc793d434186d6 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Feb 2023 20:54:23 +0800 Subject: [PATCH] Cache more stuff --- public/sw.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/sw.js b/public/sw.js index 46fa48e..ddf9f42 100644 --- a/public/sw.js +++ b/public/sw.js @@ -33,9 +33,13 @@ const imageRoute = new Route( ); registerRoute(imageRoute); -// 1-day cache for /api/v1/instance and /api/v1/custom_emojis +// 1-day cache for +// - /api/v1/instance +// - /api/v1/custom_emojis +// - /api/v1/preferences +// - /api/v1/lists/:id const apiExtendedRoute = new RegExpRoute( - /^https?:\/\/[^\/]+\/api\/v\d+\/(instance|custom_emojis)/, + /^https?:\/\/[^\/]+\/api\/v\d+\/(instance|custom_emojis|preferences|lists\/\d+)/, new StaleWhileRevalidate({ cacheName: 'api-extended', plugins: [