- [Instructor] So I'm here in 03_05,…the begin folder, working on the serviceworker.js file.…Right now, every URL that we try,…for example, if we go to localhost:5000,…it's being managed by the Service Worker.…So if I open another tab, for example /images,…it's also being managed by the Service Worker.…So basically, the Service Worker…is responding for every URL.…
But sometimes, we want to do things…different based on the URL.…So typically on the fetch event,…on the real world project,…we are going to work with routes.…So we're going to see the URL and…try to make things different based…on how the URL looks like.…We know that we already have the URL here.…That event.request.url is basically one string.…But we can create a URL object…so we can get information from it.…
So I'm going to create a new constant,…that's called this parsedurl,…and for that we are going to create…a new URL object based on that .event.request.url.…That object has several properties inside.…For example, we can see the host,…the origin, the pathname, the protocol, the port.…
- 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 Advanced
Web Portfolio Projects: Binding and Propagationwith Leigh Lawhon1h 9m 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.