February 2018
Intermediate to advanced
298 pages
8h 22m
English
Once everything is ready, you should be able to intercept requests with your service workers with the fetch event, in the following way:
self.addEventListener('fetch', e => { e.respondWith(async function() { const response = await caches.match(e.request); if(response) { return response; } return fetch(e.request); }());});
Hang on! Let's see what happened here:
Read now
Unlock full access