All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Cache Interface Documentation: Web API Methods for Persistent Storage

By

aanthonymax

8mo ago· 6 min readen

Summary

The article provides technical documentation for the Cache interface in web APIs, explaining how it enables persistent storage of Request/Response object pairs in browser memory. It details several instance methods including Cache.match(), Cache.matchAll(), Cache.add(), and Cache.addAll() that allow developers to retrieve, store, and manage cached responses. The interface works across windowed scopes and workers, not just service workers, providing long-lived memory caching capabilities for web applications.

Key quotes

· 4 pulled
The Cache interface provides a persistent storage mechanism for Request / Response object pairs that are cached in long lived memory
Cache.add() takes a URL, retrieves it and adds the resulting response object to the given cache
How long a Cache object lives is browser dependent, but a single origin's scripts can typically rely on the presence of a previously populated Cache object
The Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers
Snippet from the RSS feed
The Cache interface provides a persistent storage mechanism for Request / Response object pairs that are cached in long lived memory. How long a Cache object lives is browser dependent, but a single origin's scripts can typically rely on the presence of a

You might also wanna read