From the course: JavaScript: Service Workers

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Implement a network-first policy

Implement a network-first policy - JavaScript Tutorial

From the course: JavaScript: Service Workers

Start my 1-month free trial

Implement a network-first policy

- [Instructor] So, we have a project that is currently working offline even if we are online. Now, every time we refresh, we will see that the app is loaded immediately, so it has really good performance. That's because all the resources, or most of the resources, that are currently in the website, are coming from the local cache storage. If you press Shift Refresh, so if you press the shift key while you click on refresh, that's a normal load without service workers. You can see there is a difference with shift, and now without shift. Let's say that we want to change the color of these titles, like we don't like that color. So, if I right click, and inspect, we can see exactly the CSS selector that we need to change. It's main CSS at line 417. So, let's change that color. We go to main CSS, to that line, and we change the color. Let's say I want to change it with a red color. So, I'm saving the main CSS file, I'm going back to the browser, I'm refreshing, and I don't see any red…

Contents