How to add cache-control, expires headers to images (Content) served by S3
A few days back I made a blog post Save image as a progressive image using paperclip and imageMagick. Here is an another improvement in that list.
Adding cache control and expiry headers. Caching images improves the user experience and reduces S3 costs. It improves the user’s experience as web pages load quicker, images are already cached and it reduces S3 costs since you have fewer transfers.
From the previous blog post:
Before:
After:
Another improvement:
PS: Make sure you reprocess all the attachments :)