Giter Club home page Giter Club logo

cloudflare-cache-cloud's Introduction

Cache Cloud | Generated with Stable Diffusion

Icon generated with Stable Diffusion

Cache Cloud quickly turns your Cloudflare Workers and KV into a fast serverless cache store with HTTP endpoints, built on top of Hono.

Quick example

npx cache-cloud-cli to setup everything in 5 mins, and...

// You can define your own `cacheKey`, save and get values from it
// e.g. user%3A1%3A <= encodeURIComponent('user:1:')
const cacheKey = 'latest-blog-posts';
const response = await fetch(`${YOUR_CACHE_CLOUD_HOST}/kv/values/${cacheKey}`);

const { success, result: latestBlogPosts } = await response.json();
if (!success || !latestBlogPosts) {
  // Cache not found :(
  // Fetch and cache it here!
}

// Cache found, return it instantly!
return res.json(latestBlogPosts);

Quick links

Get Started Guide | API Doc | Detailed Benchmarks

Features

Cache Cloud leverages the edgy and serverless nature of Cloudflare Workers and KV and is very affordable.

  • HTTP first 🌐 - Cache Cloud lets you access Cloudflare Workers KV all over the world by making HTTP calls
  • Frequent Read 📖, but Infrequent Write 📝 - Cache Cloud works best when your application needs to read quickly and frequently, but writes relatively infrequently
  • Serverless 📈 - Thanks to Cloudflare Worker's infrastructure, Cache Cloud is auto-scaling, has zero cold starts with no servers to maintain.
  • Affordable 🤑 - Cache Cloud doesn't impose additional costs. Charging is entirely based on Cloudflare Workers and KV, which offer a generous free quota (100,000 requests daily) with affordable paid plans ($5/10 million requests).

Benchmarks

Note: There could be deviations if the benchmarking scripts are executed in different locations in the world.

See detailed results in the benchmarks doc

Operation latency (ms)

Read 1 key Read 5 keys Read 20 keys Write 1 key Delete 1 key List 100 keys
Mean 30 40 85 134 131 31
Min 20 25 62 101 86 22
Lower quartile (25%) 25 31 75 128 113 25
Median (50%) 27 34 80 134 132 28
Upper quartile (75%) 31 38 87 139 138 31
Max 244 373 733 313 341 158

Blogs

cloudflare-cache-cloud's People

Contributors

patrick-kw-chiu avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.