> ## Documentation Index > Fetch the complete documentation index at: https://bunny.net/docs/llms.txt > Use this file to discover all available pages before exploring further. # Managing caches > The global caches object, covering the default cache and how to open named caches. ## Default cache The `caches.default` API follows the web browsers' Cache API interface closely. It gives you a single, unnamed cache shared across requests. ```typescript theme={null} await caches.default.match(request); ``` ## Named caches You may create and manage additional Cache instances via the `caches.open` method. Named caches are useful when you want to version cache contents (e.g. `cache:v1`, `cache:v2`) so a deploy can switch over cleanly. ```typescript theme={null} const cache = await caches.open("cache:v1"); await cache.match(request); ``` > [!NOTE] > > **Note:** When using the Cache API, avoid overriding the hostname in cache requests, as this can lead to unexpected behaviour when using multiple domains associated with a PullZone. > > ```typescript theme={null} > // recommended approach: use current request url > const url = new URL(request.url); > > const cache = await caches.open("cache:v1"); > const response = await cache.match(`${url.origin}/example.html`); > ``` ## References * [Reading & writing](https://bunny.net/docs/scripting/cache/reading-writing.md): the `match`, `put`, and `delete` method reference. * [Examples](https://bunny.net/docs/scripting/cache/examples.md): end-to-end recipes using named and default caches. * [Cache API overview](https://bunny.net/docs/scripting/cache/index.md): regional behavior, limitations, and API surface. This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.