Google Pagespeed module for nginx

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by brianmercer on May 7, 2013 at 12:04am

A couple weeks ago a Google Pagespeed module for nginx was released as beta. It has some interesting filters that process things like css files, js files, images, html and headers. See https://developers.google.com/speed/docs/mod_pagespeed/filters

I added it to a test version of my Ubuntu 12.04 nginx package on Launchpad. You can install it with

add-apt-repository ppa:brianmercer/testing
aptitude update
aptitude install nginx-pagespeed

then create a directory for it (I'll do this in the package eventually)
mkdir /var/cache/nginx/pagespeed
chown www-data /var/cache/nginx/pagespeed

and add some directives to your nginx server{} section
pagespeed on;
pagespeed FileCachePath /var/cache/nginx/pagespeed;
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
location /ngx_pagespeed_statistics {
allow 127.0.0.1; deny all;
}
location /ngx_pagespeed_message {
allow 127.0.0.1; deny all;
}

Many of these optimization techniques we already do by hand. I don't have any impressions of it yet, except that the idea of doing some of these things at the web server level is interesting.

Let me know if you have any problems with the package.

Comments

How can I install it if I

Posted by superfedya on May 13, 2013 at 9:55pm

How can I install it if I compile Nginx from the source?

There are instructions in the

Posted by brianmercer on May 14, 2013 at 2:44am

Hmm, I guess I'm doing something wrong...

Posted by Gwyneth Llewelyn on May 15, 2013 at 10:53pm

So I did add-apt-repository ppa:brianmercer/testing, and that certainly worked.

But then, when running aptitude, I only get:

Couldn't find any package whose name or description matched "nginx-pagespeed"

What step am I missing here?

I'm just a virtual girl in a virtual world...

Only local images are allowed.

ah yes, it needs this in

Posted by brianmercer on May 16, 2013 at 12:36am

ah yes, it needs this in there:

aptitude update

Works great! Do I need a

Posted by superfedya on May 29, 2013 at 4:45am

Works great!
Do I need a Advanced CSS/JS Aggregation module anyway or it's useless?

But now CPU load is much

Posted by superfedya on May 29, 2013 at 11:46am

But now CPU load is much higher for Nginx. It's temporary or permanent?

Those are both good

Posted by brianmercer on May 29, 2013 at 2:42pm

Those are both good questions. I'm still experimenting with and evaluating this module. That's good to know about the CPU load.

Now cpu load is decreased. Do

Posted by superfedya on May 30, 2013 at 2:36am

Now cpu load is decreased.
Do we really need drupal's css/js optimisation modules or Google page speed can handle all this?

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /