1
votes

On my wordpress website, I use W3 Total Cache Plugin to serve files from Cloudfront. The CDN type is set to Generic Mirror. I optimize my images with EWWWW Image Optimizing Plugin and all images on my Media directory are very well optimized. The problem I have is that Google page speed says images aren't optimized because the images served are from Cloudfront. Compare the two URLs:

This is 39kb from cloudfront http://d3c9o2or2ehzw4.cloudfront.net/wp-content/uploads/2014/06/Ipad.jpg

This is 19kb from My server http://www.overcheap.com.ng/wp-content/uploads/2014/06/Ipad.jpg

What can I do to make my optimized files get served by Cloudfront?

1

1 Answers

0
votes

I assume your server has build in module to serve optimize image on the fly, for example, in Apache they have all sorts of optimization module, like mod_deflate ... etc.

But CloudFront doesn't have those and basically it is just a CDN proxying your S3 bucket that solve your latency problem. So CloudFront won't do any optimization for your images. All the optimization has to do on your side before uploading.

How about try jpegtran type of tools to optimize your images and upload to S3 again, and see if it decrease the size ? http://linux.die.net/man/1/jpegtran

And regarding to the files not updating --> if you need to upload the same file with the same name, I will suggest you to invalidate the cache first on AWS console. Because it will serve the same content everytime ( that's why it is call CDN ).