mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 01:48:50 +01:00
SWR cache /statuses/:id/context
This commit is contained in:
parent
fee37f9880
commit
a09f1ea1a3
1 changed files with 17 additions and 17 deletions
34
public/sw.js
34
public/sw.js
|
@ -46,20 +46,20 @@ const apiExtendedRoute = new RegExpRoute(
|
||||||
);
|
);
|
||||||
registerRoute(apiExtendedRoute);
|
registerRoute(apiExtendedRoute);
|
||||||
|
|
||||||
// Not caching API requests, doesn't seem to be necessary fo now
|
const apiRoute = new RegExpRoute(
|
||||||
//
|
// Matches:
|
||||||
// const apiRoute = new RegExpRoute(
|
// - statuses/:id/context - some contexts are really huge
|
||||||
// /^https?:\/\/[^\/]+\/api\//,
|
/^https?:\/\/[^\/]+\/api\/v\d+\/(statuses\/\d+\/context)/,
|
||||||
// new StaleWhileRevalidate({
|
new StaleWhileRevalidate({
|
||||||
// cacheName: 'api',
|
cacheName: 'api',
|
||||||
// plugins: [
|
plugins: [
|
||||||
// new ExpirationPlugin({
|
new ExpirationPlugin({
|
||||||
// maxAgeSeconds: 60, // 1 minute
|
maxAgeSeconds: 5 * 60, // 5 minutes
|
||||||
// }),
|
}),
|
||||||
// new CacheableResponsePlugin({
|
new CacheableResponsePlugin({
|
||||||
// statuses: [0, 200],
|
statuses: [0, 200],
|
||||||
// }),
|
}),
|
||||||
// ],
|
],
|
||||||
// }),
|
}),
|
||||||
// );
|
);
|
||||||
// registerRoute(apiRoute);
|
registerRoute(apiRoute);
|
||||||
|
|
Loading…
Reference in a new issue