diff --git a/src/App.vue b/src/App.vue index b0f1b54..87ce1d1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -69,7 +69,7 @@ export default defineComponent({ }), async created() { - const stockData = await (await fetch('https://spythere.github.io/api/stockDataNew.json')).json(); + const stockData = await (await fetch(`https://spythere.github.io/api/stockDataNew.json?t=${Math.floor(Date.now() / 60000)}`)).json(); this.store.stockData = stockData; }, diff --git a/src/components/cards/RealStockCard.vue b/src/components/cards/RealStockCard.vue index 21b4db6..f77520a 100644 --- a/src/components/cards/RealStockCard.vue +++ b/src/components/cards/RealStockCard.vue @@ -141,7 +141,7 @@ export default defineComponent({ async mounted() { const readyStockJSONData: ResponseJSONData = await ( - await fetch('https://spythere.github.io/api/readyStock.json') + await fetch(`https://spythere.github.io/api/readyStock.json?t=${Math.floor(Date.now() / 60000)}`) ).json(); if (!readyStockJSONData) { diff --git a/vite.config.ts b/vite.config.ts index 92b2624..949eba3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,22 +11,22 @@ export default defineConfig({ registerType: 'autoUpdate', workbox: { globPatterns: ['**/*.{js,css,html,png,svg,img}'], - runtimeCaching: [ - { - urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`), - handler: 'NetworkFirst', - options: { - cacheName: 'github-api-cache', - expiration: { - maxEntries: 2, - maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days - }, - cacheableResponse: { - statuses: [0, 200], - }, - }, - }, - ], + // runtimeCaching: [ + // { + // urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`), + // handler: 'NetworkFirst', + // options: { + // cacheName: 'github-api-cache', + // expiration: { + // maxEntries: 2, + // maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days + // }, + // cacheableResponse: { + // statuses: [0, 200], + // }, + // }, + // }, + // ], }, devOptions: { enabled: true,