Ship weekly scenarios with the weekly puzzle run; docs and skills
This commit is contained in:
parent
d8df1e37f6
commit
0ece48a79d
6 changed files with 42 additions and 20 deletions
|
|
@ -25,8 +25,8 @@ self.addEventListener('fetch', (e) => {
|
|||
}
|
||||
const local = url.origin === location.origin, fonts = /fonts\.(googleapis|gstatic)\.com$/.test(url.hostname);
|
||||
if (!local && !fonts) return;
|
||||
// Weekly puzzles are published between releases: ask the network first, and keep a copy for playing offline.
|
||||
if (local && url.pathname.startsWith('/puzzles/weekly/')) {
|
||||
// Weekly puzzles and scenarios are published between releases: ask the network first, and keep a copy for offline.
|
||||
if (local && (url.pathname.startsWith('/puzzles/weekly/') || url.pathname.startsWith('/scenarios/weekly/'))) {
|
||||
e.respondWith(fetch(req).then((r) => { if (r.ok) { const copy = r.clone(); caches.open(CACHE).then((c) => c.put(req, copy)); } return r; })
|
||||
.catch(() => caches.match(req).then((r) => r || Response.error())));
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue