temp: even less cache

This commit is contained in:
Jean-Baptiste Pasquier 2021-07-06 16:01:50 +02:00
parent 845836422e
commit df3425551c

View File

@ -30,21 +30,21 @@ workbox.routing.registerRoute(
}) })
); );
workbox.routing.registerRoute( // workbox.routing.registerRoute(
({ // ({
url // url
}) => [ // }) => [
'https://cdn.jsdelivr.net', // 'https://cdn.jsdelivr.net',
'https://unpkg.com', // 'https://unpkg.com',
'https://cdn.skypack.dev', // 'https://cdn.skypack.dev',
'https://jspm.dev', // 'https://jspm.dev',
'https://fonts.googleapis.com', // 'https://fonts.googleapis.com',
'https://cdn.startinblox.com' // 'https://cdn.startinblox.com'
].includes(url.origin) || /cdn/.test(url.origin), // ].includes(url.origin) || /cdn/.test(url.origin),
new workbox.strategies.StaleWhileRevalidate({ // new workbox.strategies.StaleWhileRevalidate({
cacheName: 'cdn', // cacheName: 'cdn',
}) // })
); // );
workbox.routing.registerRoute( workbox.routing.registerRoute(
({ ({
@ -64,21 +64,21 @@ workbox.routing.registerRoute(
}), }),
); );
workbox.routing.registerRoute( // workbox.routing.registerRoute(
({ // ({
request // request
}) => // }) =>
request.destination === 'style' || // request.destination === 'style' ||
request.destination === 'script', // request.destination === 'script',
new workbox.strategies.StaleWhileRevalidate({ // new workbox.strategies.StaleWhileRevalidate({
cacheName: 'assets', // cacheName: 'assets',
plugins: [ // plugins: [
new workbox.cacheableResponse.CacheableResponsePlugin({ // new workbox.cacheableResponse.CacheableResponsePlugin({
statuses: [200], // statuses: [200],
}), // }),
], // ],
}), // }),
); // );
// workbox.routing.registerRoute( // workbox.routing.registerRoute(
// ({ // ({