# @d1testflare/cache

> Cache module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers

Latest version **2.9.0** (published 2022-10-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @d1testflare/cache
pnpm add @d1testflare/cache
yarn add @d1testflare/cache
bun add @d1testflare/cache
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.9.0 |
| Published | 2022-10-04 |
| First published | 2022-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.13 |
| Dependencies | 4 |
| Unpacked size | 28.2 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3923 |
| Author | MrBBot |
| Maintainers | oconnorct1 |
| Keywords | cloudflare, workers, worker, local, cloudworker |

## Links

- npm: https://www.npmjs.com/package/@d1testflare/cache
- Repository: https://github.com/cloudflare/miniflare
- Homepage: https://github.com/cloudflare/miniflare/tree/master/packages/cache#readme
- Issues: https://github.com/cloudflare/miniflare/issues
- npm.io page: https://npm.io/package/@d1testflare/cache

## Dependencies (4)

- [undici](https://npm.io/package/undici.md) 5.9.1
- [@d1testflare/core](https://npm.io/package/@d1testflare/core.md) 2.9.0
- [@d1testflare/shared](https://npm.io/package/@d1testflare/shared.md) 2.9.0
- [http-cache-semantics](https://npm.io/package/http-cache-semantics.md) ^4.1.0

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 2.9.0 (latest) — 2022-10-04
- 2.7.1 — 2022-08-30

## README

# `@d1testflare/cache`

Cache module for [Miniflare](https://github.com/cloudflare/miniflare): a fun,
full-featured, fully-local simulator for Cloudflare Workers. See
[✨ Cache](https://miniflare.dev/storage/cache) for more details.

## Example

```js
import { Cache } from "@d1testflare/cache";
import { Response } from "@d1testflare/core";
import { MemoryStorage } from "@d1testflare/storage-memory";

const cache = new Cache(new MemoryStorage());

const key = "http://localhost";
const res = new Response("body", {
  headers: { "Cache-Control": "max-age=3600" },
});
await cache.put(key, res);

const cachedRes = await cache.match(key);
console.log(await cachedRes.text()); // body
```

---
_Source: https://npm.io/package/@d1testflare/cache · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
