Several rewrite driver factory options are duplicated between apache and nginx. Instead of duplicating this one too, a PSOL change moves them into system/, and this change takes advantage of that move.
gzip on;
gzip_proxied any;
gzip_vary on;
gzip_types application/ecmascript;
gzip_types application/javascript;
gzip_types application/json;
gzip_types application/pdf;
gzip_types application/postscript;
gzip_types application/x-javascript;
gzip_types image/svg+xml;
gzip_types text/css;
gzip_types text/csv;
gzip_types text/html;
gzip_types text/javascript;
gzip_types text/plain;
gzip_types text/xml;
gzip_http_version 1.0;
If any explicit gzip configuration is detected the gzip configuration
set by pagespeed is rolled back completely and the explicit gzip
configuration is used.
To enable/disable gzip with pagespeed the following commands can be used:
pagespeed gzip on;
pagespeed gzip off;
PSOL change for in_place_rewrite_context.cc
- Reorder setting the status code so we actually change the
ResponseHeaders that we are using to serve
- Prevent non-error http status codes from being served up.
As noted by @jeffkaufman, to prevent a potential lifetime issue with
ResponseHeaders, remove the call to ps_release_base_fetch() in
ps_decline_request().
PSOL patch:
```diff
--- ../rewriter/in_place_rewrite_context.cc (revision 4020)
+++ ../rewriter/in_place_rewrite_context.cc (working copy)
@@ -127,9 +127,20 @@
// to us.
streaming_ = false;
set_request_headers(NULL);
+ // If we cannot rewrite in-place, we should not serve a 200/OK.
+ // Serve kNotFound instead to fall back to the server's native
+ // method of serving the url and indicate we don't want it recorded
+ // either.
+ // TODO(oschaaf): When the resource is loaded via LoadFromFile,
+ // this code gets repeatedly hit for the same url. That might
+ // become a drag when the file in question is very large and popular.
+ // Marking urls that end up in this flow as not cachable in the http cache
+ // at this point had no effect (for the LoadFromFile flow at least).
+ if (!response_headers()->IsErrorStatus()) {
+ response_headers()->set_status_code(HttpStatus::kNotFound);
+ }
set_response_headers(NULL);
set_extra_response_headers(NULL);
- response_headers()->set_status_code(HttpStatus::kNotFound);
SharedAsyncFetch::HandleDone(false);
}
}
```
this adds the following configuration on "pagespeed on"
gzip on;
gzip_proxied any;
gzip_vary on;
gzip_types application/ecmascript;
gzip_types application/javascript;
gzip_types application/json;
gzip_types application/pdf;
gzip_types application/postscript;
gzip_types application/x-javascript;
gzip_types image/svg+xml;
gzip_types text/css;
gzip_types text/csv;
gzip_types text/html;
gzip_types text/javascript;
gzip_types text/plain;
gzip_types text/xml;
gzip_http_version 1.0;
If an explicit configuration is detected the gzip configuration
set by pagespeed on is rollbacked
Fixes https://github.com/pagespeed/ngx_pagespeed/issues/238
- Fix a mistake I made in https://github.com/pagespeed/ngx_pagespeed/pull/653
This is the primary reason the test starts failing, the base fetch
handled `kPreserveOnlyCacheControl` in the wrong way.
- Use `ps_set_cache_control` when copying a Cache-Control header
to nginx, as `r->headers_out.cache_control` is where modules running
after us might expect it
- Exclude a few more lines from curl's verbose output in the keep-
alive tests that I came accross when testing on ubuntu 13.10
Desktop.
Note that this does not deflake the downstream cache test yet, I will
look at that in a follow-up.
There aren't actually any changes required from r3924 to r3934 but the admin
work from previous versions wasn't completely ported before.
This change:
* adds support for /pagespeed_admin and /pagespeed_global_admin
* removes NgxPagespeedConsoleAsyncFetch using NgxBaseFetch instead
* adds options StatisticsPath, GlobalStatisticsPath, ConsolePath,
MessagesPath, AdminPath, and GlobalAdminPath which allow site owners to
control what path these are served under
* changes /ngx_pagespeed_statistics etc from default-on to default-off,
requiring explicit path configuration to function
* does not fix the problem where trunk-tracking fails tests on 1.5 post #653
- Make kPreserveOnlyCacheControl do what it says on the tin
- Serve pagespeed resources with the response headers computed
by PSOL regardless of whether downstream caching is configured.
Fixes https://github.com/pagespeed/ngx_pagespeed/issues/652
Make sure we clear the timeout event associated with resolving
a hostname in `CallbackDone()`, which would otherwise end up
calling `CallbackDone()` a second time upon firing.
Fixes https://github.com/pagespeed/ngx_pagespeed/issues/625
We need to be writing with the base name, with params stripped.
This was causing a test to "flake" under valgrind, since with it we got
to the test showing the bug slowly enough for the entry written out by
an earlier test under proper URL to expire.
* port EnrollExperiment tests.
* tricky changes to get gzip+ipro working properly.
* reduce code duplication by calling copy_response_headers_from_ngx instead
of reimplementing it.
* port Vary: Accept test changes.
The big change here is Vary: headers, which are no longer being stripped from the pagespeed response. Take a look; it might be we want to be smart about merging these headers with the original request's Vary: headers.