fix(reader): support dynamic token-fetcher for foliate PWA caching

Implement a custom callable fetcher function in the Foliate integration that
stringifies to the current auth token. This ensures backward compatibility
for older service-worker cached versions of the Foliate library expecting a
string token, while allowing newer/uncached versions to perform authenticated
requests correctly. Additionally, exclude Foliate assets from PWA precaching
to prevent stale cache bugs on Firefox.

Closes #575
This commit is contained in:
neon
2026-07-07 16:41:20 +00:00
parent 1405fdc13f
commit 0b11583f7d
5 changed files with 63 additions and 6 deletions
+1
View File
@@ -79,6 +79,7 @@ export default defineConfig({
},
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}'],
globIgnores: ['**/assets/foliate/**'],
navigateFallback: 'index.html',
navigateFallbackDenylist: [/^\/api\//],
runtimeCaching: [