chore: adjusted to new version of API vehicles data

This commit is contained in:
2024-06-08 20:53:22 +02:00
parent c252213ed9
commit 59a5fbe5ac
6 changed files with 61 additions and 68 deletions
+6 -13
View File
@@ -24,33 +24,26 @@ export default defineConfig({
cleanupOutdatedCaches: true,
runtimeCaching: [
{
urlPattern: /^https:\/\/stacjownik.spythere.eu\/api\/getSceneries/i,
handler: 'StaleWhileRevalidate',
urlPattern:
/^https:\/\/stacjownik.spythere.eu\/api\/(getVehicles|getDonators|getSceneries)/i,
handler: 'NetworkFirst',
options: {
cacheName: 'spythere-sceneries-cache',
cacheName: 'stacjownik-api-cache',
cacheableResponse: {
statuses: [0, 200]
}
}
},
{
urlPattern: /^https:\/\/stacjownik.spythere.eu\/vehicles/i,
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'spythere-vehicles-cache'
}
},
{
urlPattern: /^https:\/\/static.spythere.eu\/.*/i,
handler: 'CacheFirst',
handler: 'StaleWhileRevalidate',
options: {
cacheName: 'spythere-static-cache',
cacheableResponse: {
statuses: [0, 200]
},
expiration: {
maxEntries: 100,
maxAgeSeconds: 60 * 60 * 8
maxEntries: 100
}
}
}