Make your websites run faster, automatically -- try mod_pagespeed for Apache

Hi All,



Just wondering if anyone had tried this Apache module created by Google?



It’s supposed to automate some of the things that their Page Speed tool highlights.



[url]http://googlecode.blogspot.com/2010/11/make-your-websites-run-faster.html[/url]

[quote name=‘utilityempire’]Hi All,



Just wondering if anyone had tried this Apache module created by Google?



[/QUOTE]



Yes - I have just installed it and OMG - improves every element on our site that we have control over. Only things that our pagespeed report highlights now as “low” are off server code eg, js loaded for the ssl seal, and Facepile.



Only 1 thing marked as “High priority” which is to Combine images into CSS sprites, but with the amount I have learned about apache modules over the last 24hrs, I’ll leave this for another day.



very very happy :smiley:



Am sure I havent got the most out of the filters yet, but its early days I’ll tunker some more.

I read the description quickly… seems like a good idea! I wonder how much load it will put on the server doing everything automatically? I would love my site if it was even faster, and I think all my visitors would enjoy a fast loading site as well.

I just went through the cPanel forums and I could see that lot of peoples complaining that it is very resource intensive and it creates very high load on their VPS.

from reading some of the google material on it - the cpu load is higher when first implemented then settles back a higher normal level - but dont ask me for %s as I would even know where to begin



There is a load of stuff here that makes for good reading and examples



[url]GitHub - apache/incubator-pagespeed-mod: Apache module for rewriting web pages to reduce latency and bandwidth.



This all started last night with me trying to sort out mod_expires and following Li Lee’s excellent speedup guide within the forums (having very little linux experience - this was a challenge getting the mod_expires up and running) as we had moved the site to a dedicated box from a shared host.



I stumbled onto the mod_pagespeed by accident and am glad I did - I managed to install and get it running within 20 minutes. And what a difference.



I am sure I have only made a small inroad with it and can do a lot more to really crank it up - but for now we’re going to take a breather and come back to it in a few days.



Would be great for some of the more seasoned CSCart veterans to cast a critical eye over it too and give thier impressions.

Ok, I just installed it … don’t really notice anything to be honest!?

I didnt either with everything until I added my filters to pagespeed.conf

How it is, its worthless? or it´s very good?



Oh and i must do changes on the website or only install this module for the apache?

You have to install it and then add filters. I’m working on it now on my testserver, will let you know.

Ok, so I installed mod_pagespeed and added the following filters:



ModPagespeedEnableFilters combine_css

ModPagespeedEnableFilters rewrite_css,rewrite_javascript

ModPagespeedEnableFilters inline_css,inline_javascript

ModPagespeedEnableFilters rewrite_images

ModPagespeedEnableFilters insert_img_dimensions

ModPagespeedEnableFilters remove_comments

ModPagespeedEnableFilters extend_cache

ModPagespeedEnableFilters remove_quotes

ModPagespeedEnableFilters collapse_whitespace



This definitely made a difference. I gained some points in GTmetrix and went from 82 to Page Speed Score of 92 in google page speed.



Now, this site is not even optimized yet… and i’m sure I can squeeze some more speed out of it.



All-in-all… if you have some extra CPU resources… I think it’s safe to say this mod is worth installing.

Most of the CPU load problems were with older versions anyway.

reply from WiredTree:



Hello,



At this time, we don’t recommend installing this module. It tends to be very resource intensive in regards to disk IO. We really advise waiting for the project to mature into stability before using it on your server.

[quote name=‘Flow’]Ok, so I installed mod_pagespeed and added the following filters:



ModPagespeedEnableFilters combine_css

ModPagespeedEnableFilters rewrite_css,rewrite_javascript

ModPagespeedEnableFilters inline_css,inline_javascript

ModPagespeedEnableFilters rewrite_images

ModPagespeedEnableFilters insert_img_dimensions

ModPagespeedEnableFilters remove_comments

ModPagespeedEnableFilters extend_cache

ModPagespeedEnableFilters remove_quotes

ModPagespeedEnableFilters collapse_whitespace



This definitely made a difference. I gained some points in GTmetrix and went from 82 to Page Speed Score of 92 in google page speed.



Now, this site is not even optimized yet… and i’m sure I can squeeze some more speed out of it.



All-in-all… if you have some extra CPU resources… I think it’s safe to say this mod is worth installing.

Most of the CPU load problems were with older versions anyway.[/QUOTE]



Yikes, I just tested my page speed and received a C+ without doing the mods above. I may have Sno try this on my site depending on how much he charges of course. I gotta speed up my site a little. I notice it’s been slightly slower since traffic increase by 75% .

[quote name=‘silverbestbuy’]reply from WiredTree:



Hello,



At this time, we don’t recommend installing this module. It tends to be very resource intensive in regards to disk IO. We really advise waiting for the project to mature into stability before using it on your server.[/QUOTE]



May be this will works on vps or dedicated server ?

we have a dedicated server, and as the mod is not stable yet we would like to wait and see until the stable version comes out.

I just got done chatting with Host Gators customer support, and they recommended the google code. They insured me my server will be fine and can handle the extra resources of the code produces. I guess in the next few weeks once everything starts to slow down a bit i’ll try this mod. I’m glad you guys posted this.

try this:



When users request a page, it can take anywhere from 200 to 500ms for the backend server to stitch together the HTML page. During this time, the browser is idle as it waits for the data to arrive. In PHP you have the function flush(). It allows you to send your partially ready HTML response to the browser so that the browser can start fetching components while your backend is busy with the rest of the HTML page. The benefit is mainly seen on busy backends or light frontends.



A good place to consider flushing is right after the HEAD because the HTML for the head is usually easier to produce and it allows you to include any CSS and JavaScript files for the browser to start fetching in parallel while the backend is still processing.



Example:

















i have just put the code and it seems like it helped little more. or is it just me?

[quote]

i have just put the code and it seems like it helped little more. or is it just me?

[/quote]

It’s probably “just you”! :slight_smile:



Seriously, flush() just flushes the PHP output buffer. Unless Apache buffering is turned off, it will do no good whatsoever. If Apache buffering were off, you’d have additional performance problems.



The back-end should not be spending any time in cs-cart putting together the page (other than blocks which are dynamic). The “pages” are generally cached in the compiled cache (var/compiled) and are already “stiched”.



While the initial page load may take a bit longer while CSS and JS are cached in the browser, subsequent pages should be very fast since the majority of the graphics will also be cached in the browser.



Summary: Flush is only useful in non-webservice environments such as PHP CLI. But when used with a site manager like Apache, it provides its own buffering which is not accessible from the application.

[quote name=‘KBM’]Yikes, I just tested my page speed and received a C+ without doing the mods above. I may have Sno try this on my site depending on how much he charges of course. I gotta speed up my site a little. I notice it’s been slightly slower since traffic increase by 75% .[/QUOTE]



Are you running smartoptimizer already?

If not, installing that alone (2 minutes work and very easy) will help you speed up your site like nothing else.



Please see my post here: [url]http://forum.cs-cart.com/showthread.php?t=22059[/url]

I tied this mod in with my cdn and then did testing with tools.pingdom.com for page load time. I went from 16 seconds to 6. We have 48,000 products on our site and it always seems a bit slow but now its moving quick again.

Tried the google pagespeed module a while ago, seemed to work good for about 1 week then cpu, disk I/O, and memory resources started to be consumed. Result was a slower website, and lots of disk I/O. Maybe it has memory leaks or requires a lot of server resources to benefit from it.