Pobieranie danych o sceneriach / caching

This commit is contained in:
2022-11-15 19:50:30 +01:00
parent 2878c5d79b
commit 6240297e84
4 changed files with 60 additions and 14 deletions
+18 -1
View File
@@ -5,7 +5,7 @@ import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
server: {
port: 8081
port: 8081,
},
plugins: [
vue(),
@@ -13,6 +13,22 @@ export default defineConfig({
registerType: 'prompt',
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,img}'],
runtimeCaching: [
{
urlPattern: /^https:\/\/stacjownik-api-b9mrc\.ondigitalocean\.app\/api\/getSceneries/i,
handler: 'CacheFirst',
options: {
cacheName: 'sceneries-data-cache',
expiration: {
maxEntries: 250,
maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
],
},
devOptions: {
enabled: true,
@@ -20,3 +36,4 @@ export default defineConfig({
}),
],
});