Skip to content

v8.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 08 May 17:35
· 90 commits to master since this release
a224654

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 },
  ],
})