Noctiflorous Pansy Mulch

    @miniflare/cache
    TypeScript icon, indicating that this package has built-in type declarations

    2.4.0 • Public • Published

    @miniflare/cache

    Cache module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers. See Cache for more details.

    Example

    import { Cache } from "@miniflare/cache";
    import { Response } from "@miniflare/core";
    import { MemoryStorage } from "@miniflare/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

    Install

    npm i @miniflare/cache

    DownloadsWeekly Downloads

    21,805

    Version

    2.4.0

    License

    MIT

    Unpacked Size

    21.4 kB

    Total Files

    5

    Last publish

    Collaborators

    • mrbbot