https://www.growthbook.io/ logo
#announcements
Title
# announcements
b

brief-traffic-36675

07/21/2023, 11:11 AM
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

swift-helmet-3648

07/21/2023, 4:53 PM
Hi Pantelis, let me ask the devs and get back to you
h

happy-autumn-40938

07/21/2023, 4:57 PM
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

brief-traffic-36675

07/21/2023, 4:58 PM
Ι 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

happy-autumn-40938

07/21/2023, 5:07 PM
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

brief-traffic-36675

07/22/2023, 9:50 AM
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
8 Views