23 lines
983 B
Markdown
23 lines
983 B
Markdown
## 1. Setup
|
|
|
|
- [x] 1.1 Add `sw.js` to site root output (place in `site/public/sw.js`)
|
|
- [x] 1.2 Add service worker registration to the base layout (register only in production)
|
|
|
|
## 2. Pre-cache Site Shell
|
|
|
|
- [x] 2.1 Implement versioned cache names and an explicit cache version constant
|
|
- [x] 2.2 Implement `install` handler to pre-cache critical shell assets
|
|
- [x] 2.3 Implement `activate` handler to delete old version caches
|
|
|
|
## 3. Runtime Caching
|
|
|
|
- [x] 3.1 Implement network-first strategy for navigation/document requests with cache fallback
|
|
- [x] 3.2 Implement cache-first strategy for images/media with network fallback
|
|
- [x] 3.3 Add a bounded eviction policy for media cache size
|
|
|
|
## 4. Verification
|
|
|
|
- [ ] 4.1 Verify service worker registers in production build and does not register in dev
|
|
- [ ] 4.2 Verify repeat navigation and asset loads hit cache (Chrome DevTools Application tab)
|
|
- [ ] 4.3 Verify a new deploy triggers cache version update and old caches are removed
|