T
TanStack5mo ago
rival-black

Server Side Cache Rules

I noticed there is some initial support for static generated server function replies which caches the result on build, would be nice to have control to have some serverside calls cached for a time period then rerun, and was wondering if was on the roadmap. however after seeing another posting (credit here ) I am now wondering if this is as simple as setting cache policies in reply headers assuming your deployment target has a CDN, which I assume cloudflair pages/workers does.
1 Reply
rival-black
rival-blackOP5mo ago
doesn't look like the worker reply is cached in the cdn (just the browser off the cache control headers), however your worker can * use the cache api * use the caching automatically built into the fetch api
Cloudflare Docs
Cache using fetch · Cloudflare Workers docs
Determine how to cache a resource by setting TTLs, custom cache keys, and cache headers in a fetch request.

Did you find this page helpful?