In this video, learn how to create another ObjectStore to store the fetch datetime of each object store and invalidate it after 30 minutes.
(upbeat music) … - [Instructor] Now that we have our data stored … in IndexedDB and being retrieved, … we need to ensure we keep it up to date. … For this challenge, … you're going to create a new object store. … Inside this store, we're going to store the timestamp … that each of the other stores was last updated. … This way, we can set an expiry time for our data, … after which we can check for an update. … Depending on the data that you're working with … and how often it is likely to update, … the amount of time you want to allow … before your data expires will change. … For this challenge, let's use 30 minutes. … You may want to reduce that time when testing. … So what we want to do is first of all, … grab the data as normal and store it. … At the same time, we want to store the timestamp … of when we fetched the data. … On the next request, we want to grab the current timestamp … and compare it to the one we stored the first time around. … If the first request was more than 30 minutes ago, …
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.