PageSpeed and CDN images

I currently have a site that services images located on AWS S3 via AWS Cloudfront.

I'm not looking to install PageSpeed and I want to take advantage of the image optimization and lazy loading (out of page view) that PageSpeed offers.

My question is:

Do I need to move the images from S3 onto the Server with PageSpeed to take advantage of the image optimization and lazy loading. eg: to the images need to be local to where PageSpeed is installed or can they be external on S3 in this case?

I can see how to direct pagespeed to loadfiles (images) from the file system as below.

pagespeed LoadFromFile http://static.example.com/ /var/www/static/;

Would the answer to this be it would be faster to have the images local and use "LoadFromFile" but it's possible to use a remote repository?

thankyou Adam

EDIT: I can now see the following:

pagespeed LoadFromFileMatch "^https?://example.com/~([^/]*)/static/"
                            "/var/www/static/\\1";

It appears this might allow PageSpeed to check for local resources and then fetch from a remote HTTP location if required.

Answers


mod_pagespeed can optimize images from anywhere. By default, it optimizes images only from the same domain as the HTML, you can authorize mod_pagespeed to optimize images from any domain with:

pagespeed Domain www.example.com;

Note: This will just tell mod_pagespeed to rewrite the URLs for resources on that domain. If example.com does not have mod_pagespeed installed on it as well, this will fail! If that is the case, you can use:

pagespeed MapRewriteDomain modpagespeed.domain.com other.domain.com;

This will tell mod_pagespeed to change the domain the rewritten resources are served from so that you can actually serve the rewritten versions.

For more information see https://developers.google.com/speed/pagespeed/module/domains


Need Your Help

Visual Studio 2005 keeps “recompiling” XML Schema

visual-studio-2005 xsd custom-build-step

I have the following inconvenience while working with MS Visual Studio.

How to design an HTML table inside a PHP tag?

php html

I have got the following code from virtuemart (Joomla extension) component. The script was under a particular function and is used to show "product type" information from the database. If you go th...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.