Cloudflare CDN cache for public route expiring too quickly (origin hits every 1–2 min)
Hey folks — wondering if anyone else has seen this.
I’ve got a public route:
It returns a small static JSON payload, same for all origins.
Headers set from my route:
my route options block:
Everything looks right — yet in production I’m seeing continuous origin hits every 1–3 minutes from the same shopId and origin.
cf-cache-status briefly goes HIT, then resets, and age: never rises much above 60 seconds.
I’m fine with the cache varying by Origin (three storefront domains share the same data), but I’m puzzled why requests keep reaching the backend this often.
Is anyone else seeing similar behaviour on public routes?
Could there be something in Gadget’s Cloudflare setup, or is there another caching detail I might be missing?
TIA!4 Replies
Hello,
Could you please share the URL of the application. I'd need to investigate to be sure as to whats going on here. You might need to add more to the cache response/configs for the route to cache properly
this is part of how cloudflare's CDN network works -- they don't have one big global cache that is shared among all their servers in all their regions, they have one cache per region! so you can still get more than one hit per cache period if requests are made in different regions that each has to fill its own cache
Hi, the Gadget endpoint for production is https://storescore.gadget.app/ - the specific route i am referring to is
api/routes/GET-testimonials-public.js
In fact, the number of requests now has settled down significantly. An interesting point about the number of points of presence within the CDN. I was expecting VARY by ORIGIN as a multiplier.
I will keep monitoring but I don't think I need any more investigation. Thanks @[Gadget] Antoine and @[Gadget] Harry .Do you like this answer?