We want people to be able to install ngx_pagespeed like any other nginx module.
If PSOL were a full-fledged library with a stable interface we could simply say
"install PSOL" which might be as easy as `apt-get install psol-dev`, but it's
not. Instead we directly include a precompiled binary library along with its
headers. By building the binaries on something sufficiently old (Centos 5.4)
they should work pretty much everywhere someone might think to run
ngx_pagespeed, but building from source is still a documented option if they
don't.
Headers and binaries are from trunk of r2338, as documented in the READMEs.
Set up the background code for connecting pagespeed configuration structures
(RewriteOptions) to the companion nginx ones. Passes all the actual work
through to NgxRewriteOptions::ParseAndSetOptions which isn't written yet.
(All it does so far is interpret "pagespeed on/off".)
Adding nginx subclasses of RewriteOptions and ServerContext are a bit overkill
for this change, but we're going to need them a lot.
Once configuration is complete, any mod_pagespeed configuration directive should
work in ngx_pagespeed:
mod_pagespeed.conf:
ModPagespeedEnableFilters collapse_whitespace
ModPagespeedRunExperiment on
ModPagespeedExperimentSpec id=3;percent=50;default
ModPagespeedExperimentSpec id=4;percent=50
ngx_pagespeed.conf:
pagespeed ModPagespeedEnableFilters collapse_whitespace
pagespeed ModPagespeedRunExperiment on;
pagespeed ModPagespeedExperimentSpec "id=3;percent=50;default";
pagespeed ModPagespeedExperimentSpec "id=4;percent=50";
The `ModPagespeed` is optional, and discouraged:
ngx_pagespeed.conf:
pagespeed EnableFilters collapse_whitespace
pagespeed RunExperiment on;
pagespeed ExperimentSpec "id=3;percent=50;default";
pagespeed ExperimentSpec "id=4;percent=50";
Run all responses through PSOL's rewriter in a blocking manner. While eventually we need to be using the asynchronous rewriting interface, this is a simple proof of concept. In test/expected/test.html you can see the effect of running this code on test/www/test/html
- link in psol
- manipulate the buffer chain to add a 'processed by us' comment
- use chunked encoding to we don't have to update the headers when
we change the length of the request
- use c++ for the module