Mobile app version of vmapp.org
Login or Join
Phylliss660

: 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

@Phylliss660

Posted in: #AmazonCloudfront #Cdn

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel560

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme