Pobieranie danych z API zamiast lokalnie

This commit is contained in:
2022-11-27 15:28:56 +01:00
parent e6d22234b2
commit ff93e4cc32
11 changed files with 70 additions and 2121 deletions
+4 -23
View File
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { VitePWA } from "vite-plugin-pwa";
import { VitePWA } from 'vite-plugin-pwa';
// https://vitejs.dev/config/
export default defineConfig({
@@ -13,22 +13,7 @@ export default defineConfig({
globPatterns: ['**/*.{js,css,html,png,svg,img}'],
runtimeCaching: [
{
urlPattern: new RegExp(`^https://wiki.td2.info.pl/images/thumb\/.*`),
handler: 'NetworkFirst',
options: {
cacheName: 'td2-images-cache',
expiration: {
maxEntries: 400,
maxAgeSeconds: 60 * 60 * 24 * 14, // <== 14 days
},
cacheableResponse: {
statuses: [0, 200],
},
},
},
{
urlPattern: new RegExp(`^https://spythere.github.io/api/readyStock.json`),
urlPattern: new RegExp(`^https://spythere.github.io/api\/.*`),
handler: 'NetworkFirst',
options: {
cacheName: 'github-api-cache',
@@ -50,7 +35,3 @@ export default defineConfig({
],
});