Mercurial
comparison mrjunejune/src/public/sw.js @ 241:9c2eec61a152
[assets] Generate site images as WebP with Bazel
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 03 Aug 2026 11:26:30 -0700 |
| parents | 3b47e82ac57e |
| children | 543df0fe7168 |
comparison
equal
deleted
inserted
replaced
| 240:c345083cd8a7 | 241:9c2eec61a152 |
|---|---|
| 1 // Service Worker for MrJuneJune PWA | 1 // Service Worker for MrJuneJune PWA |
| 2 const CACHE_VERSION = 'v1'; | 2 const CACHE_VERSION = 'v2-webp'; |
| 3 const CACHE_NAME = `mrjunejune-${CACHE_VERSION}`; | 3 const CACHE_NAME = `mrjunejune-${CACHE_VERSION}`; |
| 4 | 4 |
| 5 // Files to cache immediately on install | 5 // Files to cache immediately on install |
| 6 const STATIC_CACHE = [ | 6 const STATIC_CACHE = [ |
| 7 '/', | 7 '/', |
| 86 // Cache specific file types | 86 // Cache specific file types |
| 87 const shouldCache = | 87 const shouldCache = |
| 88 url.pathname.endsWith('.css') || | 88 url.pathname.endsWith('.css') || |
| 89 url.pathname.endsWith('.js') || | 89 url.pathname.endsWith('.js') || |
| 90 url.pathname.endsWith('.svg') || | 90 url.pathname.endsWith('.svg') || |
| 91 url.pathname.endsWith('.png') || | |
| 92 url.pathname.endsWith('.jpg') || | 91 url.pathname.endsWith('.jpg') || |
| 93 url.pathname.endsWith('.webp') || | 92 url.pathname.endsWith('.webp') || |
| 94 url.pathname.endsWith('.woff') || | 93 url.pathname.endsWith('.woff') || |
| 95 url.pathname.endsWith('.woff2') || | 94 url.pathname.endsWith('.woff2') || |
| 96 url.pathname.endsWith('.ttf') || | 95 url.pathname.endsWith('.ttf') || |