{
  "type": "module",
  "source": "doc/api/api-cachestore.md",
  "modules": [
    {
      "textRaw": "Cache Store",
      "name": "cache_store",
      "introduced_in": "v7.0.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>A cache store is the storage backend used by the cache interceptor to persist\nand retrieve cached responses. A store decides which stored response to serve\nfor a request by comparing the request against the response's <code>Vary</code> header, and\nis expected to be compliant with <a href=\"https://www.rfc-editor.org/rfc/rfc9111.html\">RFC 9111</a>.</p>\n<p>undici ships two stores. <code>MemoryCacheStore</code> keeps responses in memory, while\n<code>SqliteCacheStore</code> persists them to a SQLite database. Both are available under\nthe <code>cacheStores</code> export:</p>\n<pre><code class=\"language-mjs\">import { cacheStores } from 'undici'\n\nconst { MemoryCacheStore, SqliteCacheStore } = cacheStores\n</code></pre>\n<p><code>SqliteCacheStore</code> requires the <a href=\"https://nodejs.org/api/sqlite.html\"><code>node:sqlite</code></a> API. The class is always\nexported, but constructing one throws if <code>node:sqlite</code> is not available in the\nrunning Node.js version.</p>\n<p>A cache store implements three methods — <code>get(key)</code>, <code>createWriteStream(key, value)</code>, and <code>delete(key)</code> — that operate on a <a href=\"#cachekey\"><code>CacheKey</code></a> and a\n<a href=\"#cachevalue\"><code>CacheValue</code></a>. Any object implementing this contract can be passed\nto the cache interceptor, so custom stores (for example, backed by Redis or a\nremote service) are supported as well.</p>",
      "classes": [
        {
          "textRaw": "Class: `MemoryCacheStore`",
          "name": "MemoryCacheStore",
          "type": "class",
          "meta": {
            "added": [
              "v7.0.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"https://nodejs.org/api/events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>Stores cached responses in memory. The store enforces upper bounds on the total\nnumber of responses, the total size of all responses, and the size of any single\nresponse. When a limit is exceeded, the store evicts approximately half of its\nentries and emits a <a href=\"#event-maxsizeexceeded\"><code>'maxSizeExceeded'</code></a> event.</p>\n<pre><code class=\"language-mjs\">import { interceptors, cacheStores, Agent, setGlobalDispatcher } from 'undici'\n\nconst store = new cacheStores.MemoryCacheStore({ maxSize: 50 * 1024 * 1024 })\n\nsetGlobalDispatcher(\n  new Agent().compose(interceptors.cache({ store }))\n)\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new MemoryCacheStore([options])`",
              "name": "MemoryCacheStore",
              "type": "ctor",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`options` {Object} (optional)",
                  "name": "options",
                  "type": "Object",
                  "desc": "(optional)",
                  "options": [
                    {
                      "textRaw": "`maxCount` {number} The maximum number of responses to store. **Default:** `1024`.",
                      "name": "maxCount",
                      "type": "number",
                      "default": "`1024`",
                      "desc": "The maximum number of responses to store."
                    },
                    {
                      "textRaw": "`maxSize` {number} The maximum total size, in bytes, of all stored responses. **Default:** `104857600` (100 MiB).",
                      "name": "maxSize",
                      "type": "number",
                      "default": "`104857600` (100 MiB)",
                      "desc": "The maximum total size, in bytes, of all stored responses."
                    },
                    {
                      "textRaw": "`maxEntrySize` {number} The maximum size, in bytes, of a single response body. Responses whose body exceeds this value are not cached. **Default:** `5242880` (5 MiB).",
                      "name": "maxEntrySize",
                      "type": "number",
                      "default": "`5242880` (5 MiB)",
                      "desc": "The maximum size, in bytes, of a single response body. Responses whose body exceeds this value are not cached."
                    },
                    {
                      "textRaw": "`errorCallback` {Function} A callback invoked with any error raised by the store. (optional)",
                      "name": "errorCallback",
                      "type": "Function",
                      "desc": "A callback invoked with any error raised by the store. (optional)",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Each of <code>maxCount</code>, <code>maxSize</code>, and <code>maxEntrySize</code> must be a non-negative\ninteger; a <code>TypeError</code> is thrown otherwise.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "size",
              "type": "number",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The current total size, in bytes, of all stored response bodies.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`memoryCacheStore.isFull()`",
              "name": "isFull",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` when the store has reached its `maxSize` or `maxCount` limit, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` when the store has reached its `maxSize` or `maxCount` limit, `false` otherwise."
                  }
                }
              ]
            },
            {
              "textRaw": "`memoryCacheStore.get(key)`",
              "name": "get",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request to look up. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request to look up. See `CacheKey`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {GetResult|undefined} The matching cached response, or `undefined` when there is no fresh entry for `key`. See `GetResult`.",
                    "name": "return",
                    "type": "GetResult|undefined",
                    "desc": "The matching cached response, or `undefined` when there is no fresh entry for `key`. See `GetResult`."
                  }
                }
              ],
              "desc": "<p>Looks up a cached response for <code>key</code>. A stored entry matches only when its\n<code>method</code> equals <code>key.method</code>, its <code>deleteAt</code> time is in the future, and every\nheader listed in its <code>vary</code> map matches the corresponding header in\n<code>key.headers</code>.</p>"
            },
            {
              "textRaw": "`memoryCacheStore.createWriteStream(key, value)`",
              "name": "createWriteStream",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request the response is being cached for. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request the response is being cached for. See `CacheKey`."
                    },
                    {
                      "textRaw": "`value` {CacheValue} The response metadata to store. See `CacheValue`.",
                      "name": "value",
                      "type": "CacheValue",
                      "desc": "The response metadata to store. See `CacheValue`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Writable|undefined} A writable stream that the response body is written to, or `undefined` when the response cannot be cached.",
                    "name": "return",
                    "type": "Writable|undefined",
                    "desc": "A writable stream that the response body is written to, or `undefined` when the response cannot be cached."
                  }
                }
              ],
              "desc": "<p>Returns a <a href=\"https://nodejs.org/api/stream.html#class-streamwritable\"><code>&#x3C;Writable></code></a> stream used to write the response body into the store. When\nthe stream finishes, the entry is committed; if its accumulated size exceeds <code>maxEntrySize</code>, the stream is destroyed and nothing is stored. Writing a new\nentry whose <code>key</code> matches an existing one replaces that entry.</p>"
            },
            {
              "textRaw": "`memoryCacheStore.delete(key)`",
              "name": "delete",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request whose cached responses should be removed. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request whose cached responses should be removed. See `CacheKey`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {undefined}",
                    "name": "return",
                    "type": "undefined"
                  }
                }
              ],
              "desc": "<p>Removes every cached response stored for <code>key.origin</code> and <code>key.path</code>. Throws a\n<code>TypeError</code> if <code>key</code> is not an object.</p>"
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'maxSizeExceeded'`",
              "name": "maxSizeExceeded",
              "type": "event",
              "meta": {
                "added": [
                  "v7.10.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`size` {number} The current total size, in bytes, of all stored responses.",
                      "name": "size",
                      "type": "number",
                      "desc": "The current total size, in bytes, of all stored responses."
                    },
                    {
                      "textRaw": "`maxSize` {number} The configured `maxSize` limit.",
                      "name": "maxSize",
                      "type": "number",
                      "desc": "The configured `maxSize` limit."
                    },
                    {
                      "textRaw": "`count` {number} The current number of stored responses.",
                      "name": "count",
                      "type": "number",
                      "desc": "The current number of stored responses."
                    },
                    {
                      "textRaw": "`maxCount` {number} The configured `maxCount` limit.",
                      "name": "maxCount",
                      "type": "number",
                      "desc": "The configured `maxCount` limit."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when the store exceeds its <code>maxSize</code> or <code>maxCount</code> limit, immediately\nbefore entries are evicted. The event fires only once per overflow; it is not\nemitted again until the store drops back below both limits.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `SqliteCacheStore`",
          "name": "SqliteCacheStore",
          "type": "class",
          "meta": {
            "added": [
              "v7.0.0"
            ],
            "changes": []
          },
          "desc": "<p>Stores cached responses in a SQLite database using the <a href=\"https://nodejs.org/api/sqlite.html\"><code>node:sqlite</code></a> API.\nThe constructor throws when <a href=\"https://nodejs.org/api/sqlite.html\"><code>node:sqlite</code></a> is not available.</p>\n<pre><code class=\"language-mjs\">import { interceptors, cacheStores, Agent, setGlobalDispatcher } from 'undici'\n\nconst store = new cacheStores.SqliteCacheStore({ location: './cache.db' })\n\nsetGlobalDispatcher(\n  new Agent().compose(interceptors.cache({ store }))\n)\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new SqliteCacheStore([options])`",
              "name": "SqliteCacheStore",
              "type": "ctor",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`options` {Object} (optional)",
                  "name": "options",
                  "type": "Object",
                  "desc": "(optional)",
                  "options": [
                    {
                      "textRaw": "`location` {string} The location of the SQLite database. Use `':memory:'` for an in-memory database. **Default:** `':memory:'`.",
                      "name": "location",
                      "type": "string",
                      "default": "`':memory:'`",
                      "desc": "The location of the SQLite database. Use `':memory:'` for an in-memory database."
                    },
                    {
                      "textRaw": "`maxCount` {number} The maximum number of responses to store. **Default:** `Infinity`.",
                      "name": "maxCount",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "The maximum number of responses to store."
                    },
                    {
                      "textRaw": "`maxEntrySize` {number} The maximum size, in bytes, of a single response body. Responses whose body exceeds this value are not cached. Must not exceed `2000000000` (2 GB). **Default:** `2000000000` (2 GB).",
                      "name": "maxEntrySize",
                      "type": "number",
                      "default": "`2000000000` (2 GB)",
                      "desc": "The maximum size, in bytes, of a single response body. Responses whose body exceeds this value are not cached. Must not exceed `2000000000` (2 GB)."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p><code>maxCount</code> and <code>maxEntrySize</code> must be non-negative integers; a <code>TypeError</code> is\nthrown otherwise, or if <code>maxEntrySize</code> is greater than 2 GB.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`sqliteCacheStore.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {undefined}",
                    "name": "return",
                    "type": "undefined"
                  }
                }
              ],
              "desc": "<p>Closes the connection to the underlying SQLite database.</p>"
            },
            {
              "textRaw": "`sqliteCacheStore.get(key)`",
              "name": "get",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request to look up. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request to look up. See `CacheKey`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {GetResult|undefined} The matching cached response, or `undefined` when there is no fresh entry for `key`. The returned `body` is a {Buffer}. See `GetResult`.",
                    "name": "return",
                    "type": "GetResult|undefined",
                    "desc": "The matching cached response, or `undefined` when there is no fresh entry for `key`. The returned `body` is a {Buffer}. See `GetResult`."
                  }
                }
              ],
              "desc": "<p>Looks up a cached response for <code>key</code>, comparing the request method and every\nheader named in the stored <code>vary</code> map.</p>"
            },
            {
              "textRaw": "`sqliteCacheStore.set(key, value)`",
              "name": "set",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request the response is being cached for. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request the response is being cached for. See `CacheKey`."
                    },
                    {
                      "textRaw": "`value` {CacheValue} The response to store, with its `body` set to a {Buffer}, an {Array} of {Buffer}, or `null`. See `CacheValue`.",
                      "name": "value",
                      "type": "CacheValue",
                      "desc": "The response to store, with its `body` set to a {Buffer}, an {Array} of {Buffer}, or `null`. See `CacheValue`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {undefined}",
                    "name": "return",
                    "type": "undefined"
                  }
                }
              ],
              "desc": "<p>Writes a response into the database directly, without going through a stream. If\nthe body exceeds <code>maxEntrySize</code>, nothing is stored. When an entry already exists\nfor <code>key</code> it is overwritten; otherwise a new row is inserted and old entries are\npruned to honour <code>maxCount</code>. This method is used internally by\n<a href=\"#sqlitecachestorecreatewritestreamkey-value\"><code>sqliteCacheStore.createWriteStream()</code></a>.</p>"
            },
            {
              "textRaw": "`sqliteCacheStore.createWriteStream(key, value)`",
              "name": "createWriteStream",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request the response is being cached for. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request the response is being cached for. See `CacheKey`."
                    },
                    {
                      "textRaw": "`value` {CacheValue} The response metadata to store. See `CacheValue`.",
                      "name": "value",
                      "type": "CacheValue",
                      "desc": "The response metadata to store. See `CacheValue`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Writable|undefined} A writable stream that the response body is written to, or `undefined` when the response cannot be cached.",
                    "name": "return",
                    "type": "Writable|undefined",
                    "desc": "A writable stream that the response body is written to, or `undefined` when the response cannot be cached."
                  }
                }
              ],
              "desc": "<p>Returns a <a href=\"https://nodejs.org/api/stream.html#class-streamwritable\"><code>&#x3C;Writable></code></a> stream used to write the response body into the store. When\nthe stream finishes, the buffered body is committed via <a href=\"#sqlitecachestoresetkey-value\"><code>sqliteCacheStore.set()</code></a>. If the body exceeds\n<code>maxEntrySize</code>, the stream is destroyed and nothing is stored.</p>"
            },
            {
              "textRaw": "`sqliteCacheStore.delete(key)`",
              "name": "delete",
              "type": "method",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CacheKey} The request whose cached responses should be removed. See `CacheKey`.",
                      "name": "key",
                      "type": "CacheKey",
                      "desc": "The request whose cached responses should be removed. See `CacheKey`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {undefined}",
                    "name": "return",
                    "type": "undefined"
                  }
                }
              ],
              "desc": "<p>Removes every cached response stored for the URL derived from <code>key.origin</code> and\n<code>key.path</code>. Throws a <code>TypeError</code> if <code>key</code> is not an object.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "size",
              "type": "number",
              "meta": {
                "added": [
                  "v7.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of responses currently stored in the database.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Implementing a custom cache store",
          "name": "implementing_a_custom_cache_store",
          "type": "module",
          "desc": "<p>A cache store is any object that implements the <code>CacheStore</code> interface:</p>\n<ul>\n<li><code>get(key)</code> — Look up a response. Returns a <a href=\"#getresult\"><code>GetResult</code></a>,\n<code>undefined</code>, or a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> resolving to either.</li>\n<li><code>createWriteStream(key, value)</code> — Return a <a href=\"https://nodejs.org/api/stream.html#class-streamwritable\"><code>&#x3C;Writable></code></a> to receive the response\nbody, or <code>undefined</code> if the response cannot be stored.</li>\n<li><code>delete(key)</code> — Remove all responses for <code>key</code>. May return a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a>.</li>\n</ul>\n<p>Returning a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> from <code>get</code> or <code>delete</code> lets a store be backed by an\nasynchronous resource; the cache interceptor awaits these values, including on\nthe revalidation and stale-while-revalidate paths.</p>",
          "modules": [
            {
              "textRaw": "`CacheKey`",
              "name": "`cachekey`",
              "type": "module",
              "desc": "<p>The request a response is being looked up or stored for.</p>\n<ul>\n<li><code>origin</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The request origin.</li>\n<li><code>method</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The request method.</li>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The request path.</li>\n<li><code>headers</code> <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type\"><code>&#x3C;Record></code></a>&#x3C;<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>[]> The request headers, used to\nsatisfy <code>Vary</code>. (optional)</li>\n</ul>",
              "displayName": "`CacheKey`"
            },
            {
              "textRaw": "`CacheValue`",
              "name": "`cachevalue`",
              "type": "module",
              "desc": "<p>The metadata of a cached response, excluding its body.</p>\n<ul>\n<li><code>statusCode</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The response's HTTP status code.</li>\n<li><code>statusMessage</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The response's HTTP status message.</li>\n<li><code>headers</code> <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type\"><code>&#x3C;Record></code></a>&#x3C;<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>[]> The response headers.</li>\n<li><code>vary</code> <a href=\"https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type\"><code>&#x3C;Record></code></a>&#x3C;<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>[] | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a>> The header names listed in the\nresponse's <code>Vary</code> header mapped to the values they had in the original\nrequest. A value is <code>null</code> when that header was absent from the original\nrequest. (optional)</li>\n<li><code>etag</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The response's entity tag. (optional)</li>\n<li><code>cacheControlDirectives</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The parsed <code>Cache-Control</code> directives of the\nresponse. (optional)</li>\n<li><code>cachedAt</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The time, in milliseconds, at which the response was\ncached.</li>\n<li><code>staleAt</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The time, in milliseconds, at which the response becomes\nstale.</li>\n<li><code>deleteAt</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The time, in milliseconds, at which the response must be\nevicted. A store must not return a response once this time has passed.</li>\n</ul>\n<p>The <code>vary</code> map drives response selection. For a response such as:</p>\n<pre><code class=\"language-http\">Vary: content-encoding, accept\ncontent-encoding: utf8\naccept: application/json\n</code></pre>\n<p>the recorded map is:</p>\n<pre><code class=\"language-js\">{\n  'content-encoding': 'utf8',\n  accept: 'application/json'\n}\n</code></pre>\n<p>If the original request did not include the <code>accept</code> header, its value is\nrecorded as <code>null</code>:</p>\n<pre><code class=\"language-js\">{\n  'content-encoding': 'utf8',\n  accept: null\n}\n</code></pre>",
              "displayName": "`CacheValue`"
            },
            {
              "textRaw": "`GetResult`",
              "name": "`getresult`",
              "type": "module",
              "desc": "<p>The value returned by <code>get</code>. It contains every field of\n<a href=\"#cachevalue\"><code>CacheValue</code></a> plus the response body.</p>\n<ul>\n<li><code>body</code> <a href=\"https://nodejs.org/api/stream.html#class-streamreadable\"><code>&#x3C;Readable></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols\"><code>&#x3C;Iterable></code></a> | <a href=\"https://tc39.github.io/ecma262/#sec-asynciterable-interface\"><code>&#x3C;AsyncIterable></code></a> | <a href=\"https://nodejs.org/api/buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The cached response\nbody. (optional)</li>\n</ul>",
              "displayName": "`GetResult`"
            }
          ],
          "displayName": "Implementing a custom cache store"
        }
      ]
    }
  ]
}