From the course: JavaScript: Service Workers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Summary of cache strategies - JavaScript Tutorial
From the course: JavaScript: Service Workers
Summary of cache strategies
- [Instructor] Let's analyze all the Cache Strategies that we have been seeing during this chapter. We have seen that we can precache typically on the install event, then we have to deliver those assets to the browser cache first, network first stale while revalidate and any combination that we can create because we can create our own strategy. For example, we can do network first but also update resources that are not in the cache. We can do several strategies per route or per destination of the resource such as if it's a style, if it's an emash, we can also create dyno and maximum of emashes that we want and store in the cache so we can create our own algorithm. So when we are precaching, basically the service worker is downloading the resources from the server, in this case expressed as that little block with Res, that's resource and downloading that resource in the app cache. When we are using cache first and we do have the resource in the cache storage, the problem that appears…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Understand the new Cache API5m 36s
-
(Locked)
Prepare the project4m 30s
-
(Locked)
Prefetch files on install5m 1s
-
(Locked)
Visualize your cache3m 37s
-
(Locked)
Implement a cache-first policy6m 12s
-
(Locked)
Implement a network-first policy5m 10s
-
(Locked)
Cache new elements after install5m 41s
-
(Locked)
Use stale-while-revalidate6m 46s
-
(Locked)
Deliver alternate content when offline6m 28s
-
(Locked)
Keep your storage clean5m 28s
-
(Locked)
Summary of cache strategies4m 36s
-
-
-
-