1
0
Fork 0

Cache more stuff

This commit is contained in:
Lim Chee Aun 2023-02-23 20:54:23 +08:00
parent 3037a5d2a1
commit b7c1078c26

View file

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