v8.0.0
What's Changed
- New streamlined service worker makes it easier to customize service worker logic. Your service worker is now configured at sw/service-worker.js. Here is an example:
// sw/service-worker.js
import { configureServiceWorker } from 'react-storefront/sw'
const maxAgeSeconds = 60 * 60 // 1 hour
configureServiceWorker({
api: [
{ path: '/api/p/[productId]', maxAgeSeconds },
{ path: '/api/s/[subcategoryId]', maxAgeSeconds },
{ path: '/api', maxAgeSeconds },
],
})