temp: even less cache

This commit is contained in:
Jean-Baptiste Pasquier 2021-07-06 16:01:50 +02:00
parent 845836422e
commit df3425551c
1 changed files with 30 additions and 30 deletions

View File

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