Today I tested the new plugin for nginx developed Google: ngx_pagespeed. It’s the equivalent for nginx to apache’s mod_pagespeed.
Installation
Just go to the github page for ngx_pagespeed and the follow the instructions there.I used the alpha-r2748-build.
Sidenote: With it I ran into a problem with the wp-admin dashboard when trying to write this post. If you’re interested, check out the issue on Github.
Test scenario
For testing I used my static-content-only photography-website with gzipped content, minified css and cached static files. Initially I thought that’s not really something worth testing with, but the test-results showed that even there I could optimize the page speed with ngx_pagespeed.
I used the test suite from http://www.webpagetest.org/ to get a first look.
Test runs
First run
The first run was without ngx_pagespeed enabled:
Document Complete | Fully Loaded | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Load Time | First Byte | Start Render | Speed Index | Time | Requests | Bytes In | Time | Requests | Bytes In | |
First View | 2.853s | 0.864s | 1.961s | 2783 | 2.853s | 12 | 163 KB | 4.499s | 12 | 164 KB |
Repeat View | 0.741s | 0.284s | 0.718s | 1900 | 0.741s | 2 | 2 KB | 1.155s | 3 | 2 KB |
As you can see, loading the webpage for the first time took 2.853 seconds, subsequent loadings took 0.741 seconds.
Second run
The second run was with ngx_pagespeed enabled but without a fetcher.
Document Complete | Fully Loaded | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Load Time | First Byte | Start Render | Speed Index | Time | Requests | Bytes In | Time | Requests | Bytes In | |
First View | 2.341s | 0.605s | 1.839s | 2352 | 2.341s | 10 | 163 KB | 4.335s | 11 | 163 KB |
Repeat View | 3.711s | 0.277s | 1.074s | 2890 | 3.711s | 7 | 164 KB | 3.847s | 8 | 165 KB |
As you can see, the page loaded 0.5 seconds faster than without pagespeed enabled. But strangely, the repeated views took considerably longer as if caching didn’t happen.
Third run
Third run was with pagespeed and fetcher enabled.
Document Complete | Fully Loaded | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Load Time | First Byte | Start Render | Speed Index | Time | Requests | Bytes In | Time | Requests | Bytes In | |
First View | 2.049s | 0.321s | 1.520s | 1925 | 2.049s | 11 | 150 KB | 2.311s | 12 | 151 KB |
Repeat View | 0.727s | 0.274s | 0.625s | 1107 | 0.727s | 3 | 2 KB | 0.989s | 4 | 2 KB |
With the fetcher enabled the first and subsequent views were finally both fater than without pagespeed.
Result
It’s worth it for my small static-content-only webpage.