Add Cache Response using Web Cache API #56305
Replies: 2 comments
-
undici implement Cache and CacheStorage, https://github.com/nodejs/undici/blob/main/docs/docs/api/CacheStorage.md |
Beta Was this translation helpful? Give feedback.
-
Node.js does not currently support the Web Cache API like Deno or Cloudflare Workers. However, caching can still be achieved using How to Cache in Node.js (Using
|
Beta Was this translation helpful? Give feedback.
-
I see a neighbour of NodeJS, Deno has implement Cache Response using Web Cache API. I think if NodeJS can catch up this it will be great.
Background
I create web app that utilize Cache Response using SvelteKit & Cloudflare Pages (functions). The reason I choose Cloudflare because SvelteKit and Cloudflare Pages communicate using Web API standards which is makes more easier to implement a Cache Response.
Btw, I'm almost keep it in two repositories and replace the Worker (plain) with Hono because it supports Cache Middleware. But, I think it makes more complicated if I do this way.
Also, the Cache Middleware of Hono framework currently support in Cloudflare and Deno.
Syntax
The GET function comes from SvelteKit but the
caches
comes from Cloudflare.Beta Was this translation helpful? Give feedback.
All reactions