How to Inspect and Manage Cache Storage in Safari Web Inspector

Modern Progressive Web Apps (PWAs) and offline-capable websites rely on the Cache Storage API (caches) to store paired network Request and Response objects. Managed primarily through Service Workers, Cache Storage provides fine-grained programmatic control over asset caching—allowing web applications to load instantaneously on slow connections, serve stale-while-revalidate resources, and operate completely offline. However, when Service Workers fail to purge outdated script bundles, cache invalidation bugs arise, leaving users stranded on obsolete application versions. Apple Safari Web Inspector provides built-in tools to inspect cached network requests, review HTTP headers, and purge Cache Storage containers.

Understanding the Cache Storage Architecture

Unlike standard HTTP browser caches that operate transparently according to Cache-Control response headers, the Cache Storage API is an asynchronous, developer-managed key-value database. Each origin can create multiple named cache containers (such as v1-static-assets, v1-api-data, or workbox-precache).

Inside each container, individual HTTP requests function as lookup keys mapped directly to full Response payloads (including status codes, body streams, and response headers). Because Cache Storage operates independently of conventional cookie and localStorage quotas, inspecting and auditing these containers requires dedicated developer tooling in Safari.

Opening Safari Web Inspector and Accessing Storage

To inspect Cache Storage in Safari on macOS:

  1. Ensure Developer features are enabled in Safari > Settings > Advanced > Show features for web developers.
  2. Navigate to the target website or Progressive Web App in Safari.
  3. Open Web Inspector by pressing Option + Command + I (or right-click the page and choose Inspect Element).
  4. In the Web Inspector toolbar, select the Storage tab.

In the navigation sidebar on the left side of the Storage tab, locate the Caches (or Cache Storage) section located alongside Cookies, Local Storage, Session Storage, and IndexedDB.

Inspecting Named Caches and Request/Response Pairs

To explore cached resources:

  1. In the sidebar under Caches, click the disclosure triangle to reveal all named cache buckets associated with the current origin.
  2. Click on a specific cache name (for example, static-v2).
  3. The central panel displays a structured table listing all cached request entries stored within that container.

The table provides essential columns for auditing offline functionality:

  • Name / URL: The full resource URI that serves as the lookup key.
  • Type: The MIME type of the stored asset (e.g., text/javascript, text/css, image/webp).
  • Size: The byte footprint of the cached payload.
  • Time: The timestamp when the resource was originally fetched and committed to storage.

Reviewing Cached HTTP Response Headers and Payloads

Selecting any individual resource entry in the table opens a dedicated inspection pane in the details sidebar:

  • Headers: Displays both Request Headers (such as Accept, User-Agent) and Response Headers (such as Content-Type, ETag, Last-Modified). This allows you to verify whether your Service Worker captured an authentic 200 OK response or mistakenly cached an opaque or error response.
  • Preview: Renders the stored asset content directly—displaying formatted source code for JavaScript and CSS bundles, rendered image canvases for graphical assets, or parsed JSON trees for cached API endpoints.

Deleting Individual Cached Items and Purging Containers

During frontend development, you frequently need to purge stale caches to test new Service Worker deployment lifecycles or force fresh network requests:

  • Deleting a Single Item: Right-click the specific URL row in the central table and choose Delete, or select the row and press the Delete key.
  • Purging an Entire Cache Container: Right-click the named cache folder in the sidebar (e.g., static-v1) and select Delete. The entire container and all its stored responses are purged immediately from disk.

Auditing Cache Storage via the Console

In addition to the visual interface, you can interact programmatically with Cache Storage using the native JavaScript API in the Web Inspector Console:

// List all cache container names
caches.keys().then(keys => console.log("Active Caches:", keys));

// Check if a specific URL exists in the cache
caches.open("static-v2").then(cache => {
  cache.match("/app.bundle.js").then(response => {
    console.log("Cached response found:", response ? response.status : "Not cached");
  });
});

Evaluating cache queries directly in the Console helps verify cache-first and network-first Service Worker fallback strategies during automated and exploratory web audits.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.