Skip to content

Releases: AdiRishi/cachified-adapter-cloudflare-kv

v2.2.1

04 May 14:52
fac15fd
Compare
Choose a tag to compare

Changes from 2.2.0

There was a bug in the Github CI/CD pipeline that stopped version 2.2.0 from getting a proper release. Here was the changelog

  • Update Cloudflare worker types to the recommended default compatibility date of 2023-07-01

Patch Changes

v2.1.0

10 Feb 00:53
d71df0a
Compare
Choose a tag to compare

Minor Changes

  • 7c092cf: Set @epic-web/cachified peer dependency to ^5.1.1
    This is necessary as this package uses updated type definitions from @epic-web/cachified that were introduced in 5.1.1

v2.0.0

10 Feb 00:42
b686c53
Compare
Choose a tag to compare

Major Changes

Minor Changes

  • 4be40a6: Add generics to the cloudflare cache implementation
    This is in an effort to match the behavior of @epic-web/cachified since 5.1.0

v1.0.1

05 Dec 10:27
74259da
Compare
Choose a tag to compare

Patch Changes

  • deed297: Improve documentation and unit test coverage

    • Greatly improved adapter integration tests
    • Improve README documentation

v1.0.0

30 Nov 12:26
131c6d7
Compare
Choose a tag to compare

Major Changes

  • 7725598: 🎉 I'm thrilled to announce the official 1.0 release of cachified-adapter-cloudflare-kv! 🚀

    📦 Installation

    To get started, simply install the package along with its peer dependency @epic-web/cachified:

    npm install cachified-adapter-cloudflare-kv @epic-web/cachified

    💡 Usage

    Integrating the adapter into your Cloudflare Workers is straightforward. Here's a quick example to show you how it's done:

    import { cachified, Cache } from "@epic-web/cachified";
    import { cloudflareKvCacheAdapter } from "cachified-adapter-cloudflare-kv";
    
    export interface Env {
      KV: KVNamespace;
    }
    
    export async function getUserById(
      userId: number,
      cacheAdapter: Cache,
    ): Promise<Record<string, unknown>> {
      return cachified({
        key: `user-${userId}`,
        cache: cacheAdapter,
        async getFreshValue() {
          return { id: userId, name: "John Doe" };
        },
        ttl: 60_000, // 1 minute
        staleWhileRevalidate: 300_000, // 5 minutes
      });
    }
    
    export default {
      async fetch(
        request: Request,
        env: Env,
        ctx: ExecutionContext,
      ): Promise<Response> {
        env.CACHIFIED_KV_CACHE = cloudflareKvCacheAdapter({ kv: env.KV });
        const user = await getUserById(1, env.CACHIFIED_KV_CACHE);
        return new Response(JSON.stringify(user), {
          headers: { "content-type": "application/json" },
        });
      },
    };

    For detailed usage and configuration options, please refer to the README in our repository.

    I'm excited to share the latest updates to cachified-adapter-cloudflare-kv with you. Your feedback and contributions are greatly appreciated as we work together to enhance web performance. 🌐

v0.1.0

29 Nov 16:49
3b42eb8
Compare
Choose a tag to compare

Minor Changes

  • 3af27b6: Improve documentation and add usage examples in the README

Patch Changes

  • a4239d8: Add jsdoc comments to adapter code

v0.0.3

29 Nov 15:29
5b98838
Compare
Choose a tag to compare

Patch Changes

  • 312cfaf: Fix incorrect esm file name in package.json export

v0.0.2

29 Nov 15:10
24e9839
Compare
Choose a tag to compare

Patch Changes

  • d7cd7c9: Correctly build package output when publishing a release

v0.0.1

29 Nov 14:05
bfeadbd
Compare
Choose a tag to compare

Patch Changes

  • 8ffa8ff: Specify peerDependencies as external packages in vite build