Setting Cache-Control Header

Google PageSpeed Insights is giving me one of the criterias that requires some work:

Leverage browser caching

I’m using Amazon S3 + CloudFront to serve my static assets.  To set the HTTP headers for Cache-Control, I used an application on Windows called “CloudBerry Explorer for Amazon S3”.

The application lets me manage many different types of server storage, including AWS S3.  To update multiple file headers:

  • In CloudBerry Explorer for Amazon S3, right click the file(s) and select: Set HTTP Headers
  • Click: Add
  • Use the following settings:
    • Http Header: Cache-Control
    • Value: max-age=604800

max-age is in seconds.  Converting 604800 seconds will be equivalent to 1 week.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: