In this video, get a code walk-through of how to complete the challenge.
(upbeat music) … - [Instructor] So let's have a look … at how I would solve this challenge. … First off, we need to create the store. … So, at the top of our service worker file, … I'm going to scroll down … to where we are creating the other stores. … I'm just going to copy one … of the other stores and paste it underneath. … And I'm going to change the name to storeInvalidation. … And I'm going to change the variable name … again to storeInvalidation.. … So we've got our new store. … Now we need to store the timestamp … of when the fetch request is being made. … So if we scroll down to the fetch request, … I'm going to create a new variable here, now, … and set that to date.now, … which is the time stamp for the current fetch request. … Now that we've got the current timestamp, … we can store it in our new object store. … We could just store it once, but I'm going to store it once … for each of the three object stores. … This is because we made site … to have a different expiry length, …
Skill Level Advanced
Web Programming Foundationswith Morten Rand-Hendriksen58m 44s Beginner
1. Front-End Performance Tools
- 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.