A normal .pagespeed. url looks like:
256x192vPuzzle.jpg.pagespeed.ic.alA0AdlR-2.jpg
If someone turns on RunExperiment, however, we generate urls like:
256x192vPuzzle.jpg.pagespeed.a.ic.alA0AdlR-2.jpg
256x192vPuzzle.jpg.pagespeed.b.ic.alA0AdlR-2.jpg
The new section is always a single letter between a and z. We need to catch
these and pass them through to PageSpeed.
Before the experiment code was just setting the need_to_store_experiment_data
option but nothing was looking at that option. Rewrote the code, basing it on
InstawebContext::SetFuriousStateAndCookie, in order to actually set the cookie
to support the experiment. There are tests for this functionality, but we're
waiting on issue #40 to be able to run them.
Manual testing (with line wrapping):
$ curl -s -D- http://localhost:8050/mod_pagespeed_example/ | grep GFURIOUS
Set-Cookie: _GFURIOUS=1; Expires=Fri, 01 Feb 2013 21:38:31 GMT;
Domain=.localhost; Path=/
$ curl -s -D- http://localhost:8050/mod_pagespeed_example/ | grep GFURIOUS
Set-Cookie: _GFURIOUS=2; Expires=Fri, 01 Feb 2013 21:42:56 GMT;
Domain=.localhost; Path=/
And it responds properly on receiving the cookie, although it did that before
this change too.
guard against server only options being configured at location scope this
introduces a duplicated list of server-level-only options from mod_instaweb.cc,
which is a short term solution and should be removed later on
Fixes#99.
Shut down the driver factory before the proxy fetch factory.
shutting down the driver factory will make sure that all worker
threads are stopped, This prevents in-flight callbacks to
destroyed proxy fetch factories, so we should be able to safely
delete them
This fixes#109.
If we're proxying the origin server might advertise `Accept-Ranges: bytes` but
we don't support range requests. So we need to remove the header. We also need
to not add `Vary: Accept-Encoding` twice, and because the gzip encoding will add
it later we need to remove it here.
The file cache needs a slow worker or it will never run the cleanup code. In
configurations with multiple server blocks, like jefftk.com, the rewrite
driver factory could cause a a segfault by deleting the slow worker when setting
up caches. So this fixes#126.