Skip to content

The Cache API provides a mechanism for storing network requests and retrieving their corresponding responses during run-time. This repository is associated with the article that introduces users to the Cache API and shows a few of its tricks.

Notifications You must be signed in to change notification settings

Jordanirabor/Working_With_The_Cache_API

Repository files navigation

Working with the JavaScript Cache API

Introduction

The Cache API provides a mechanism for storing network requests and retrieving their corresponding responses during run-time. It can be used in the absence of an internet connection (or presence of a flaky one) and this makes it integral to the creation of Progressive Web Applications (web applications that work optimally offline like native applications).

Because it is impossible to predetermine your userbase at development time, it is important to build your web services so that they can be accessed by a broad spectrum of users who may not have the best hardware or are plagued with slow internet connections.

Usage

The Cache API is great at caching URL-addressable resources, that is, you should use the Cache API when you work with network resources that are necessary to load your application. These network resources may include file-based content, assets, API responses and web pages.

For the storage of significant amounts of structured data (including files/blobs) you ideally want to use the IndexedDB API.

This repository contains several code snippets that show us how to use the Cache API in our code.

About

The Cache API provides a mechanism for storing network requests and retrieving their corresponding responses during run-time. This repository is associated with the article that introduces users to the Cache API and shows a few of its tricks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published