mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-10 05:37:47 +02:00
feat:#22 refactor to cache room schedule and webworker config
This commit is contained in:
@@ -82,7 +82,7 @@ export default defineConfig({
|
||||
},
|
||||
registerType: "autoUpdate",
|
||||
workbox: {
|
||||
globPatterns: ["**/*.{js,css,html,ico,png,svg,json,vue,txt,woff2}"],
|
||||
globPatterns: ["**/*.{js,css,html,ico,png,svg,json,vue,txt,woff2}", "/api/schedule/rooms"],
|
||||
cleanupOutdatedCaches: true,
|
||||
runtimeCaching: [
|
||||
{
|
||||
@@ -96,6 +96,17 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: ("/api/schedule/rooms"),
|
||||
method: "GET",
|
||||
handler: "StaleWhileRevalidate",
|
||||
options: {
|
||||
cacheName: "room-schedule-cache",
|
||||
expiration: {
|
||||
maxAgeSeconds: 12 * 60 * 60, // 12 hours
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
urlPattern: /^https?.*/,
|
||||
handler: "NetworkFirst",
|
||||
|
Reference in New Issue
Block a user