Test remove /instance and /preferences from SW cache

This commit is contained in:
Lim Chee Aun 2024-09-17 00:45:27 +08:00
parent 51ac7611d4
commit ac9b43cacc

View file

@ -75,13 +75,11 @@ const iconsRoute = new Route(
registerRoute(iconsRoute); registerRoute(iconsRoute);
// 1-day cache for // 1-day cache for
// - /api/v1/instance
// - /api/v1/custom_emojis // - /api/v1/custom_emojis
// - /api/v1/preferences
// - /api/v1/lists/:id // - /api/v1/lists/:id
// - /api/v1/announcements // - /api/v1/announcements
const apiExtendedRoute = new RegExpRoute( const apiExtendedRoute = new RegExpRoute(
/^https?:\/\/[^\/]+\/api\/v\d+\/(instance|custom_emojis|preferences|lists\/\d+|announcements)$/, /^https?:\/\/[^\/]+\/api\/v\d+\/(custom_emojis|lists\/\d+|announcements)$/,
new StaleWhileRevalidate({ new StaleWhileRevalidate({
cacheName: 'api-extended', cacheName: 'api-extended',
plugins: [ plugins: [