Netlify Images CDN `Cache-Control`

Hi there!
I have a question regarding the Cache-Control policy, for now, it seems that Netlify sends public,max-age=0,must-revalidate to completely ignore any browser cache.

How can I change this behaviour? I have my images immutable by URL so I’d like to set it to public, max-age=31536000, immutable


Hi, @Vadym_Raksha. That can be done with header rules:

Hi @luke.

I’ve added the next config to my _headers file:

  Cache-Control: public, max-age=31536000, immutable

But the requested path still returns public,max-age=0,must-revalidate

I think that the main problem is that looks like Images CDN is running on Netlify’s internal functions, but there is a limitation in the document which you’ve provided:

Custom headers apply only to files Netlify serves from our backing store. If you are proxying content to your site or dealing with a URL handled by a function or edge function such as a server-side rendered (SSR) page, custom headers won’t be applied to that content

Hi @Vadym_Raksha,

The headers should be applied on the original image path and not on the /.netlify/images path. The orignal image’s headers should be applied to the ones served by the Image CDN as well. Could you try that please?