Summary
In this chapter, we saw how the Fetch and Cache APIs are critical for the service workers. To get the most out of service workers, you need to be able to intercept and manipulate requests and the server responses. Because service workers rely on asynchronous functions (Promises), you must use Fetch, as a new replacement for XMLHttpRequest.
The Cache API provides a new storage medium in the browser, which is highly specialized for request/response pairs. The API is a rich platform, providing the maximum amount of control over network resources.
Your goal is to use the best logic and platform resources to make your website load quickly and work offline. Now that you know how the Fetch and Cache APIs work, it's time to start crafting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access