mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-21 16:55:25 +03:00
Workbox expiration plugin not working as expected
This commit is contained in:
parent
ad7193d067
commit
b3681a93ee
1 changed files with 21 additions and 18 deletions
39
public/sw.js
39
public/sw.js
|
@ -96,24 +96,27 @@ const apiExtendedRoute = new RegExpRoute(
|
||||||
);
|
);
|
||||||
registerRoute(apiExtendedRoute);
|
registerRoute(apiExtendedRoute);
|
||||||
|
|
||||||
const apiIntermediateRoute = new RegExpRoute(
|
// Note: expiration is not working as expected
|
||||||
// Matches:
|
// https://github.com/GoogleChrome/workbox/issues/3316
|
||||||
// - trends/*
|
//
|
||||||
// - timelines/link
|
// const apiIntermediateRoute = new RegExpRoute(
|
||||||
/^https?:\/\/[^\/]+\/api\/v\d+\/(trends|timelines\/link)/,
|
// // Matches:
|
||||||
new StaleWhileRevalidate({
|
// // - trends/*
|
||||||
cacheName: 'api-intermediate',
|
// // - timelines/link
|
||||||
plugins: [
|
// /^https?:\/\/[^\/]+\/api\/v\d+\/(trends|timelines\/link)/,
|
||||||
new ExpirationPlugin({
|
// new StaleWhileRevalidate({
|
||||||
maxAgeSeconds: 1 * 60, // 1min
|
// cacheName: 'api-intermediate',
|
||||||
}),
|
// plugins: [
|
||||||
new CacheableResponsePlugin({
|
// new ExpirationPlugin({
|
||||||
statuses: [0, 200],
|
// maxAgeSeconds: 1 * 60, // 1min
|
||||||
}),
|
// }),
|
||||||
],
|
// new CacheableResponsePlugin({
|
||||||
}),
|
// statuses: [0, 200],
|
||||||
);
|
// }),
|
||||||
registerRoute(apiIntermediateRoute);
|
// ],
|
||||||
|
// }),
|
||||||
|
// );
|
||||||
|
// registerRoute(apiIntermediateRoute);
|
||||||
|
|
||||||
const apiRoute = new RegExpRoute(
|
const apiRoute = new RegExpRoute(
|
||||||
// Matches:
|
// Matches:
|
||||||
|
|
Loading…
Reference in a new issue