For cache control, does the code use the `CDN-Cach...
# announcements
b
For cache control, does the code use the
CDN-Cache-Control
or just the
Cache-Control
. I am asking because: • From this issue it seems the
Cache-Control
is leveraged • It seems that CloudFlare that we are using is respecting either
CDN-Cache-Control
or
Cloudflare-CDN-Cache-Control
According to CloudFlare docs:
Cache-Control
, if also returned by the origin, is proxied as is and does not affect caching decisions made by Cloudflare.
s
Hi Pantelis, let me ask the devs and get back to you
h
Hi Pantellis. We are using Fastly now, not CloudFlare - I believe Fastly does not give any special treatment to
CDN-Cache-Control
or similar non-standard headers. Is there an issue you're trying to solve, such as customizing your cache TTL?
b
Ι was wondering if for example I have the API proxied via CloudFlare and the API goes down, if a request will receive cached content from CloudFlare
h
There's no reason that shouldn't work, although your mileage may vary. Right now, we have the public features endpoint cached via
Copy code
Cache-control: public, max-age=30, stale-while-revalidate=3600, stale-if-error=36000
Your CDN should respect these directives. If not, you should be able to override / make your own CDN caching rules for this endpoint. Not sure the CloudFlare specific way of doing this though. The issue you linked to would allow the user to configure these rules a bit more using environment variables rather than needing to write CDN-level overrides.
b
Your CDN should respect these directives.
Yes but CloudFlare explicitly states it doesn't (unless I am misinterpreting sth). In any case I think this is not an issue to bug you with, this is more on our side to check, just wanted a second opinion and maybe a feedback from some user who has CFlare in front of a GB deployment