Skip to content
Snippets Groups Projects
Commit 1f69c8d3 authored by Hangzhi Yu's avatar Hangzhi Yu
Browse files

PWA fixes

parent 619810ac
No related branches found
No related tags found
1 merge request!1123Resolve "Finalise Vuetify app as SPA"
......@@ -141,7 +141,7 @@ export default defineConfig({
base: "/",
workbox: {
navigateFallback: "/",
navigateFallbackAllowlist: [new RegExp("^/(?!django)[^.]*$")],
navigateFallbackAllowlist: [new RegExp("^/(?!(django|admin|graphql|__icons__))[^.]*$")],
additionalManifestEntries: ["/", "/django/offline/"],
inlineWorkboxRuntime: true,
modifyURLPrefix: {
......@@ -149,6 +149,10 @@ export default defineConfig({
},
globPatterns: ["**/*.{js,css,eot,woff,woff2,ttf}"],
runtimeCaching: [
{
urlPattern: new RegExp("^/(?!(django|admin|graphql|__icons__))[^.]*$"),
handler: "CacheFirst",
},
{
urlPattern: new RegExp("/django/.*"),
handler: "NetworkFirst",
......@@ -158,16 +162,12 @@ export default defineConfig({
expiration: {
maxAgeSeconds: 60 * 60 * 24,
},
broadcastUpdate: {
channelName: "cache-or-not", // TODO: Check whether this actually works
options: {},
},
precacheFallback: {
fallbackURL: "/django/offline/",
},
cacheableResponse: {
headers: {
"PWA-Is-Cacheable": "true", // FIXME: Header is apparently not checked
"PWA-Is-Cacheable": "true",
},
},
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment