Search code examples
amazon-web-servicesamazon-cloudfront

How to add Cache headers to Cloudfront?


I'm using cloudfront with no special settings. when I run webpagetest, it gives me an "F" for static content. Is there any way to get cloudfront to put out the correct cache headers?

Here are my results from a page that has cloudfront. I'm not sure this is still live

http://www.webpagetest.org/result/150207_29_PAF/1/details/


Solution

  • You need to add these headers (max-age or expires) on your origin. It is the origin that decides how long objects should stay in cache