: How to invalidate images on Amazon CloudFront after optimising them? After checking on Google PageSpeed Insights, I have optimised the images on several websites using jpegoptim and optipng. Obviously
After checking on Google PageSpeed Insights, I have optimised the images on several websites using jpegoptim and optipng.
Obviously a lot of the images are now smaller and they have new timestamps, but they have not been updated through the Amazon CloudFront CDN.
The expire headers in .htaccess have been set for one year.
There are many hundreds of images that have been optimised, so manually invalidating them is not that feasible.
What is the best way to do this?
More posts by @Phylliss660
1 Comments
Sorted by latest first Latest Oldest Best
If you have the names of the files you can paste those into CloudFront's invalidation web interface.
On Linux and Mac, you can get all the filenames easily by selecting the files in the file browser, copying them (Ctrl+C or Cmd+C) then pasting into a text editor. Then use find/replace to get them in the correct format for AWS. That doesn't work on Windows though.
Alternatively, you could write a super quick script in PHP to get the file names and output that for copy-pasting into AWS.
The other method would be to do it programmatically. Download the SDK and follow the tutorials and docs on the site for your chosen language.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.