- [Instructor] I'm back in the code.…I'm in the Begin folder, in 03_02,…and so far, we have been listening…for the fetch event.…So we are actually seeing all the network requests…that are going through our service worker,…but we are not actually doing anything with that.…So besides doing a console load,…we can take the event argument…and execute a function known as respondwith.…
And that's the function that has all the power…inside service workers.…Because we can respond with an HTTP response,…or a promise of that object.…In our case, we are going to start creating…a response that we will create on the fly.…So in a static response that I'm going to create right here.…And for that, I'm going to use a response constructor…available in Java Script within the service worker.…
This is an actual http response…that we are synthesizing from our service worker.…That receives at least one argument…that's mandatory to the body.…So, basically, what we want to show in the browser.…So for now, I can just take my URL, for example,…
- Service worker life cycle
- Registering service workers
- Handling service worker events
- Updating service workers
- Acting as a network proxy
- Configuring cache storage
- Communicating with clients
- Optimizing web performance
Skill Level Intermediate
1. A New Citizen for the Web
2. Work with Service Workers
3. Acting as a Network Proxy
4. Cache Storage
5. Work with APIs in the Service Worker
6. Tips and Tricks for Web Performance
Next steps1m 55s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.