Access to the default cache is enabled by default:
Named Caches
You can access a namespaced cache using open. Note that you cannot name your
cache default, trying to do so will throw an error:
Persistence
By default, cached data is stored in memory. It will persist between reloads,
but not different Miniflare instances. To enable
persistence to the file system, specify the cache persistence option:
Manipulating Outside Workers
For testing, it can be useful to put/match data from cache outside a Worker. You
can do this with the getCaches method:
Disabling
Both default and named caches can be disabled with the disableCache option.
When disabled, the caches will still be available in the sandbox, they just
won't cache anything. This may be useful during development:
Was this helpful?
What did you like?
What went wrong?
Thank you for helping improve Cloudflare's documentation!