summaryrefslogtreecommitdiff
path: root/worker.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-04-22 14:28:56 +0300
committerAndrew Dolgov <[email protected]>2020-04-22 14:28:56 +0300
commit2e25e5a1ce62d7153c84bba89ffb0893054f2665 (patch)
tree9737edebd9a0f00dc61badaa87659ebf726b396b /worker.js
parent056aee7927911c5bc36c02b741a62bc74d9538a4 (diff)
force-return read.html from cache if failed
Diffstat (limited to 'worker.js')
-rw-r--r--worker.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/worker.js b/worker.js
index a2b9f59..9791d8d 100644
--- a/worker.js
+++ b/worker.js
@@ -133,6 +133,8 @@ this.addEventListener('fetch', function(event) {
}).catch(function() {
if (req.url[req.url.length-1] == "/" || req.url.match("index.php")) {
return caches.match("offline.html");
+ } else if (req.url.match("read.html")) {
+ return caches.match("read.html");
} else {
return caches.match(req.url);
}