Window: caches property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.

보안 컨텍스트: 이 기능은 일부 또는 모든 지원 브라우저보안 컨텍스트 (HTTPS)에서만 사용할 수 있습니다.

Window 인터페이스의 caches 읽기 전용 속성은 현재 맥락과 연관 있는 CacheStorage 객체를 반환합니다. 이 객체는 오프라인 사용을 위한 에셋 저장과, 요청에 대한 사용자화 응답을 생성하는 것과 같은 기능을 가능하게 합니다.

A CacheStorage object.

예제

아래 예제는 윈도우가 캐시된 데이터를 검색하는 방법을 보여줍니다.

js
window.caches.open("v1").then((cache) => {
  return cache.match("/list");
});

명세서

Specification
Service Workers
# self-caches

브라우저 호환성

같이 보