Add custom headers to caddy based on mime

(V C) #1

I need to set a header for my CDN based on mime time.
Eg: s-maxage
For images it should be days,
for other it should be few minutes.

Any ideas? I looked at plugins but no joy.

(Matthew Fay) #2

Hi @V_C, welcome to the Caddy community.

The http.expires plugin is the closest you’re going to get, I think.

It sets an Expires header, but you could probably layer another Caddy proxy on top to translate that from Expires to any arbitrary header name you like.