{
  "type": "module",
  "source": "doc/api/api-cachestorage.md",
  "modules": [
    {
      "textRaw": "CacheStorage",
      "name": "cachestorage",
      "type": "module",
      "desc": "<p>Undici exposes a W3C spec-compliant implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage\">CacheStorage</a> and <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Cache\">Cache</a>.</p>",
      "modules": [
        {
          "textRaw": "Opening a Cache",
          "name": "opening_a_cache",
          "type": "module",
          "desc": "<p>Undici exports a top-level CacheStorage instance. You can open a new Cache, or duplicate a Cache with an existing name, by using <code>CacheStorage.prototype.open</code>. If you open a Cache with the same name as an already-existing Cache, its list of cached Responses will be shared between both instances.</p>\n<pre><code class=\"language-mjs\">import { caches } from 'undici'\n\nconst cache_1 = await caches.open('v1')\nconst cache_2 = await caches.open('v1')\n\n// Although .open() creates a new instance,\nassert(cache_1 !== cache_2)\n// The same Response is matched in both.\nassert.deepStrictEqual(await cache_1.match('/req'), await cache_2.match('/req'))\n</code></pre>",
          "displayName": "Opening a Cache"
        },
        {
          "textRaw": "Deleting a Cache",
          "name": "deleting_a_cache",
          "type": "module",
          "desc": "<p>If a Cache is deleted, the cached Responses/Requests can still be used.</p>\n<pre><code class=\"language-mjs\">const response = await cache_1.match('/req')\nawait caches.delete('v1')\n\nawait response.text() // the Response's body\n</code></pre>",
          "displayName": "Deleting a Cache"
        }
      ],
      "displayName": "CacheStorage"
    }
  ]
}