What is CacheStorage?

Technology CommunityCategory: PWAWhat is CacheStorage?
VietMX Staff asked 3 years ago

CacheStorage is a storage mechanism in browsers for storing and retrieving network requests and response. It stores a pair of Request and Response objects. The Request as the key and Response as the value.

CacheStorage is not a Service Worker API, but it enables SW to cache network responses so that they can provide offline capabilities when the user is disconnected from the network.

The caches (an instance of CacheStorage) object is used to access the CacheStorage, to retrieve, store and delete objects.