Constructor

CachedRangeResponsePlugin

new CachedRangeResponsePlugin()

Example

const workboxSW = new WorkboxSW();

const cacheFirstRangeHandler = workboxSW.strategies.cacheFirst({
  cacheName: 'range-requests',
  // There's no need to instantiate the class; all methods are static.
  plugins: [workbox.rangedRequests.CachedRangeResponsePlugin]
});

// Create a route which will match all requests that have a Range: header,
// and handle them using a cache-first strategy, taking the Range: header
// into account.
workboxSW.registerRoute(
  ({event}) => event.request.headers.has('range'),
  cacheFirstRangeHandler
);