Hacker News new | past | comments | ask | show | jobs | submit login

Curious if there's a plugin yet for adding caching headers to static assets?



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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: