mirror of
https://github.com/Spythere/genera-tor.git
synced 2026-05-03 05:28:13 +00:00
Pobieranie danych o sceneriach / caching
This commit is contained in:
+18
-1
@@ -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({
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user