HCL Commerce Version 9.1.18.0 or later

Service worker caching for PWA

The service worker uses Serwist to implement different caching strategies based on resource types.

Caching strategy
  • CacheFirst: Retrieves content from the cache first. If the content is not cached, it fetches it from the network.
  • StaleWhileRevalidate: Serves cached content immediately while updating the cache in the background.
  • NetworkFirst: Attempts to fetch content from the network first. If the network request fails, it falls back to the cache.

Developers can customize cache configurations by following the standard Ruby customization guidelines available in the Next.js store git bundle.