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); 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( const apiExtendedRoute = new RegExpRoute(
/^https?:\/\/[^\/]+\/api\/v\d+\/(instance|custom_emojis)/, /^https?:\/\/[^\/]+\/api\/v\d+\/(instance|custom_emojis|preferences|lists\/\d+)/,
new StaleWhileRevalidate({ new StaleWhileRevalidate({
cacheName: 'api-extended', cacheName: 'api-extended',
plugins: [ plugins: [