Make us live in peace with nginx's SSI module:
- Moved our module so that we we see the content that the ssi module produces as
a whole. (right before the gzip module does its work).
- Made the header and content filters bail out for subrequests, so we don't
attempt to rewrite the sub requests that the ssi module fires.
- Changed NGX_HTTP_SSI_BUFFERED to use an unused flag, so I could rule out that
the SSI module got confused by ngx_pagespeed manipulating that flag as well.
- Handled the case in ps_update() where CollectAccumulatedWrites gives us a null
cl
Squash-merge of Otto's #242.
Makes sure we use the LoopbackRouteFetcher, and also wires up AddHeadersFetcher.
Note that this pulls in loopback_route_fetcher.cc from svn revision r2649
The LoopbackRouteFetcher is applied unconditionally, while in mod_pagespeed it
is not applied when one of these configuration settings is true:
* disable_loopback_routing
* slurping_enabled, or
* test_proxy is set
I added a TODO for that.
(Sqash-merge of Otto's #193.)
This wires up cleanup code shared memory segments.
It uses slightly modified copies of pthread_shared_mem.cc/h, containing a change
proposal to support our ordering of events during a configuration reload.
It can be tested and reviewed through this branch.
I did some extensive tests, it seems segment cleanup is not perfect yet
(segments for named locks, per vhost statistics segments). I think we need to
fix that in the trunk-tracking branch or in a separate pull though. It seems the
current trunk of psol has improvements that may fix this, and fixing it in this
pull will make it larger and more complex then I would like it to be.
Squash-merge of Otto's #179.
This adds an NgxMessageHandler, that uses ngx_log_error to output messages. It
is heavily based on apache_message_handler from mod_pagespeed.
It falls back to an internal GoogleMessageHandler if the required initialisation
has not been performed yet.
It can also install a crash handler, that will try to log a backtrace upon
receiving certain signals. In preparation of us porting /ngx_pagespeed_messages,
it also keeps the last few messages in a SharedCircularBuffer
(Squash-merge of Otto's #163)
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.
Link against the debug versions of the mod_pagespeed libraries when nginx is
configured with --with-debug.
Requires that said libraries have been pre-built with BUILDTYPE=Debug.
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