Skip to content

Commit

Permalink
Switch to network first for now
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarrough committed Mar 29, 2020
1 parent 9640bd5 commit c154f80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox

const {registerRoute} = workbox.routing
const {precacheAndRoute} = workbox.precaching
const {CacheFirst, StaleWhileRevalidate} = workbox.strategies
const {CacheFirst, NetworkFirst, StaleWhileRevalidate} = workbox.strategies
const {CacheableResponse} = workbox.cacheableResponse

console.log('hello from service worker')
Expand All @@ -18,7 +18,7 @@ precacheAndRoute([{url: '/index.html', revision: '1'}])
// Catch all js and css files and cache them.
registerRoute(
/\.(?:js|css)$/,
new StaleWhileRevalidate({
new NetworkFirst({
cacheName: 'static-resources'
})
)
Expand Down

0 comments on commit c154f80

Please sign in to comment.