CDN and authentication “AuthBasic”

Hello,

I'm testing the OVH CDN on a domain protected by AuthBasic authentication (in a .htaccess).

I add Cache-Control "max-age" directives and can see that the response headers contain them. However, no files appear to be cached; I get x-cdn-cache: MISS each time.

Is requiring authentication compatible with using the CDN?

Hi @TechS

CDNs, by default, do not cache responses that contain this header to avoid a critical security risk, so OVHcloud's CDN behaves correctly. When it detects a request with credentials, it marks it as “non‑cacheable” (it’s like doing a BYPASS) and forwards it directly to your origin server.

Hope I helped you,
Sergio Turpín

That seems logical; I just wanted to get confirmation. Thank you.