© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•6mo ago•
15 replies
Horiwix

Cache-Control simple question

Is it possible to have a setup where user from public internet hitting my public API (running as worker) would get a cached response from CF edge (before hitting my API), thus saving me requests count for my free plan?

I made my responses return
Cache-Control
Cache-Control
header like this:
        return c.json(response.results, 200, {
            'Cache-Control': 'public, max-age=3600, s-maxage=3600'
        });
        return c.json(response.results, 200, {
            'Cache-Control': 'public, max-age=3600, s-maxage=3600'
        });

And haven't done anything else, I assume the
s-maxage
s-maxage
would mean that edge would save it, but that doesn't work (I can't see
CF-Cache-Status
CF-Cache-Status
header in my API response or any cache status header).

I know if I set it up to use Cache API, it would work, but that would mean that all requests would still hit my API and it would run some minimal compute to check if cache contains data, and return from it.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

MongoDB simple question
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
15mo ago
Why does the Cache API cache automatically add or change the `maxage` in the `cache-control` header?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Trying to make a simple cache using a cloudflare worker with hono.
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Workers Cache vs Pages Cache
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
7mo ago