MENU

Fun & Interesting

Service Workers - Controlling Every Fetch Call

Steve Griffith - Prof3ssorSt3v3 11,001 lượt xem 4 years ago
Video Not Working? Fix It Now

This is the sixth video in the Understanding Service Workers series.
This video explains how to use the respondWith method, combined with using the Fetch API and the Cache API to intercept and manage every file asset request that comes from the browser.

Code from video: https://gist.github.com/prof3ssorSt3v3/5c3368c26f7051963e7a46a25348c901

Full Service Worker Video Playlist: https://www.youtube.com/watch?v=NJRu3pmmN-4&list=PLyuRouwmQCjl4iJgjH3i61tkqauM-NTGj

MDN reference for respondWith: https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith

Comment