How to cache images hosted on Amazon S3? Google PageSpeed insights is giving me warning "Serve static content with an efficient cache policy" but how to cache images hosted on Amazon S3?
What we have to do is set up Cache header on all images in our AWS S3 folder. In order to do so, go to your amazon S3 account and mark all folders where images are stored:
Click on Actions and click "Edit metadata".
In next window select System defined in dropdown menu for Type and then add "Cache-control" as key and as value add max-age=31536000 (1 year)
Next, apply your changes and wait until AWS finishes with setting up headers for all images in all selected folders:
And that is it!
Your images now have cache headers and this will increase your SEO performance.