Setting headers and caching with cloudflare pages

Where can I set headers, cache controls or mime types (e.g. webmanifest does not seem to be recognized correctly).

On e.g. Vercel you could set that on a per page basis via a vercel.json file.

What is the best way to set this on a per page basis e.g. during the deplyoment?
Can we add that information on a per page basis with cloudflare pages?

Thanks for you help!

Hi @vinzent,

I don’t think you can set headers directly in Pages, so you would need a custom Worker in front, to handle this.

https://developers.cloudflare.com/workers/examples/alter-headers

Thanks for the idea.
Most assets are static currently - adding it with a “dynamic worker” seems to defeat all the benefits of a static asset.

Any other thought / approaches?

Why would this be the case?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.