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.
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.
We weren't respecting the XHeaderValue configuration option. If someone sets:
pagespeed XHeaderValue "ngx_pagespeed";
We should see:
...
Cache-Control: max-age=0, no-cache
X-Page-Speed: ngx_pagespeed
...
Before we were only respecting it for .pagespeed. resources.
Fixes#115
When a request is cancelled part way through nginx calls the cleanup
handler. This was set to delete the base fetch, but the proxy fetch was
sometimes not done with it yet. Both nginx and pagespeed must be finished with
the base fetch before it's safe to delete it. Pagespeed calls Done(), and this
adds Release() for nginx to call. Whichever is called second deletes the
base_fetch. We use a count of references that starts at two and is decremented
atomically with a memory barrier once when Done() is called and once when
Release() is called.
Fixes#103, #104, and #106.
Because we're a non-blocking server we need to run a scheduler thread or else
alerts we set might not fire. We need to be careful to start it after we fork.
Better long term would be to use an nginx timer and avoid the extra thread;
tracking this in #111.
Fixes#55
- restores slow worker initialization/termination
- amend an error I apparently made while rebasing to head:
- do not null the lru cache when using memcached (accidentally
left in)
- remove debug fprintf's
- remove comment about virtual hosts
- restore a TODO
- abort when memcached is configure and we fail to connect
to the memcached interface
The pagespeed api for handling logs has changed, we need to change with it in
order to build against the latest pagespeed optimization libraries.
Separately, a new test was added to the generic system test that depends on the
property cache (insert_dns_prefetch). We've not ported the property cache yet,
so this test will fail, and I've added it to the list of failing tests.
Merge of Otto's pull request #105:
This wires up and executes cleanup code.
There is an issue when sending SIGTERM to a worker under high load, I will
create a separate issue for that. Normal shutdowns and reloads are working.
Fixes#84.
The issue with workers under high load is #109.
Example:
pagespeed FetchProxy 127.0.0.1:8081;
With a proxy set the fetcher will send all outside requests through the proxy.
Like ModPagespeedFetchProxy, this is intended to be used for load tests.
For now, this must be set in the 'http' block.
Fixes#98, and is needed for #41.
ServerContext::GetQueryOptions modifies the url passed to it, removing any
ModPagespeedFoo=Bar query parameters. CreateNewProxyFetch needs that modified
url but we were giving it the unmodified one.
Fixes#83