added own caching for ical feed

This commit is contained in:
Elmar Kresse
2024-07-22 20:23:56 +02:00
parent a9084d62f6
commit 08dc4b9185
6 changed files with 56 additions and 13 deletions

View File

@@ -85,6 +85,17 @@ export default defineConfig({
globPatterns: ["**/*.{js,css,html,ico,png,svg,json,vue,txt,woff2}"],
cleanupOutdatedCaches: true,
runtimeCaching: [
{
urlPattern: ({ url }) => url.pathname.startsWith('/api/feed'),
method: 'GET',
handler: 'NetworkFirst',
options: {
cacheName: 'calendar-feed-cache',
expiration: {
maxAgeSeconds: 12 * 60 * 60, // 12 hours
},
},
},
{
urlPattern: /^https?.*/,
handler: "NetworkFirst",