Vercel: cache-control for images

Is it possible to add cache-control headers for images when delpoying to Vercel? It doesn’t seem to work out-of-the box with the default vercel.json file from the documentation. image files seem to get a max-age=0 as cache-control header.

What should I add to vercel.json to add cache-control for files like png, jpg and svg, coming from the wp-content folder?

Hi @dominique,

Caching of static files is automatically handled by Vercel. In their documentation you can read

Static caching is automatic for all deployments. This means that no changes need to be made to headers. You get the best performance possible out of the box with zero configuration required.

But you can add custom headers to images by using their vercel.json configuration file

Hope this helps

1 Like

Thanks for the tip!