Browse Source

Store node pages for offline use

pm2
Luke Childs 8 years ago
parent
commit
f71afe78e4
  1. 2
      public/sw.js

2
public/sw.js

@ -54,7 +54,7 @@ self.addEventListener('fetch', function(event) {
// Cache the response for certain pages // Cache the response for certain pages
.then(function(response) { .then(function(response) {
if(requestUrl.pathname === '/') { if(requestUrl.pathname === '/' || requestUrl.pathname.startsWith('/node/')) {
caches.open(cacheName).then(function(cache) { caches.open(cacheName).then(function(cache) {
// Modify the response html so we know when it was cached // Modify the response html so we know when it was cached

Loading…
Cancel
Save