Skip to content

Instantly share code, notes, and snippets.

@glauberramos
Created October 10, 2017 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glauberramos/1c87e820b9cf970c1fca8070c2765551 to your computer and use it in GitHub Desktop.
Save glauberramos/1c87e820b9cf970c1fca8070c2765551 to your computer and use it in GitHub Desktop.
Runtime caching using workbox
workboxSW.router.registerRoute('https://cdnjs.cloudflare.com/(.*)', workboxSW.strategies.staleWhileRevalidate({}), 'GET');
workboxSW.router.registerRoute('https://res.cloudinary.com/dc3dnmmpx/image/upload/(.*)', workboxSW.strategies.staleWhileRevalidate({}), 'GET');
workboxSW.router.registerRoute('https://unpkg.com/(.*)', workboxSW.strategies.staleWhileRevalidate({}), 'GET');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment