only cache if not 404

This commit is contained in:
William Blythe
2019-01-04 08:01:02 +11:00
parent deeb525433
commit b400db8216

View File

@@ -8,7 +8,13 @@ if (workbox) {
workbox.routing.registerRoute( workbox.routing.registerRoute(
new RegExp('/(.*?)'), new RegExp('/(.*?)'),
workbox.strategies.staleWhileRevalidate() workbox.strategies.staleWhileRevalidate({
plugins: [
new workbox.cacheableResponse.Plugin({
statuses: [0, 200]
})
]
})
); );
workbox.routing.registerRoute( workbox.routing.registerRoute(