mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-27 23:46:37 +01:00
feat: Implement offline cache for sw, and autoupdating (#431)
This commit is contained in:
@@ -25,7 +25,21 @@ export default defineNuxtConfig({
|
||||
pwa: {
|
||||
workbox: {
|
||||
navigateFallbackDenylist: [/^\/api/],
|
||||
cleanupOutdatedCaches: true,
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /^\/api/,
|
||||
handler: "NetworkFirst",
|
||||
method: "GET",
|
||||
options: {
|
||||
cacheName: "api-cache",
|
||||
cacheableResponse: { statuses: [0, 200] },
|
||||
expiration: { maxAgeSeconds: 60 * 60 * 24 },
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
registerType: "autoUpdate",
|
||||
injectRegister: "script",
|
||||
injectManifest: {
|
||||
swSrc: "sw.js",
|
||||
|
||||
Reference in New Issue
Block a user