Cache
6 days ago
- #Service Workers
- #Caching
- #Web Development
- The Cache interface provides persistent storage for Request/Response pairs, accessible in both windowed scopes and workers.
- Cache objects are origin-specific, can be named, and require manual updates and purging.
- Browsers enforce storage limits per origin, potentially deleting all data if space is needed.
- Cache methods include match, matchAll, add, addAll, put, delete, and keys for managing cached responses.
- Example usage involves checking for cached fonts, fetching missing ones, and caching new responses.
- Service workers can manage cache versions, deleting outdated caches during activation.
- Cache operations do not automatically honor HTTP caching headers or handle Set-Cookie headers.