Re:Caddy 0.9 Released with All New Core
by kylemathews on Tuesday July 19, 2016 @01:50PM
(#12123420)
Curious if there's a plugin yet for adding caching headers to static assets?
[ Parent
| on HN ]
No plugin for only caching headers, but you can do that easily using the headers plugin or headers_downstream within the proxy plugin.
As an example:
header / Cache-Control "no-cache, max-age=86400"
header /images/ Cache-Control "max-age=86400"
header /css/ Cache-Control "max-age=604800"
header /fonts/ Cache-Control "max-age=604800"
header /icons/ Cache-Control "max-age=604800"
If you want to add the header only to static assets that can be done, but is a bit harder.