fix: bw/stats 404, gateway links, history crash
- swr.ts: remove useBandwidth(), drop bw from useDashboard() - events/route.ts: skip bandwidth SSE (Kubo 0.28.0 unsupported) - usage/page.tsx: remove getBWStats call + bw references - helpers.ts: gatewayLink -> ipfs.maos.dedyn.io (subdomain only) - upload/page.tsx: fix local gatewayLink (subdomain only) - storage.ts: update default gatewayUrl, add defensive getHistory()
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
+13
-18
@@ -1,30 +1,25 @@
|
||||
/* ── IPFS Portal — Service Worker v2 ──
|
||||
/* ── IPFS Portal — Service Worker v3 ──
|
||||
*
|
||||
* Cache strategieën per route type:
|
||||
* - Precache: app shell (alle pages)
|
||||
* - Precache: alleen publieke pages (auth-protected pages worden
|
||||
* gecachet via stale-while-revalidate tijdens normaal gebruik)
|
||||
* - Cache-first: static assets (fonts, images, CSS, JS)
|
||||
* - Network-first: API calls (/_next/data, /api/*)
|
||||
* - Stale-while-revalidate: navigatie requests
|
||||
*
|
||||
* Let op: auth-protected pages (dashboard, upload, settings, etc.)
|
||||
* worden NIET geprecached — tijdens installatie is er geen sessie-
|
||||
* cookie, dus de middleware redirect naar /login. Alleen publieke
|
||||
* pagina's in de precache.
|
||||
*/
|
||||
|
||||
const CACHE = 'ipfs-portal-v2';
|
||||
const STATIC_CACHE = 'ipfs-portal-static-v2';
|
||||
const DATA_CACHE = 'ipfs-portal-data-v2';
|
||||
const CACHE = 'ipfs-portal-v4';
|
||||
const STATIC_CACHE = 'ipfs-portal-static-v4';
|
||||
const DATA_CACHE = 'ipfs-portal-data-v4';
|
||||
|
||||
const PRECACHE_URLS = [
|
||||
'/',
|
||||
'/dashboard',
|
||||
'/upload',
|
||||
'/explorer',
|
||||
'/pins',
|
||||
'/history',
|
||||
'/usage',
|
||||
'/peers',
|
||||
'/users',
|
||||
'/ipns',
|
||||
'/login',
|
||||
'/settings',
|
||||
'/profile',
|
||||
];
|
||||
|
||||
/* ── Install: precache app shell ── */
|
||||
@@ -86,9 +81,9 @@ self.addEventListener('fetch', (event) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 3. Navigation → stale-while-revalidate
|
||||
// 3. Navigation → network-first (nooit stale HTML serveren, HMR breekt)
|
||||
if (isNavigation(request)) {
|
||||
event.respondWith(staleWhileRevalidate(request, CACHE));
|
||||
event.respondWith(networkFirst(request, CACHE));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user