Commit Graph

284 Commits

Author SHA1 Message Date
Jeff Kaufman 25e9fba38c console: support /pagespeed_console
sligocki is adding a feature to pagespeed where it will parse your statistics
for you and determine if there are any problems.  This CL wires up the
ConsoleHandler and also includes a few required files in the build process.

It doesn't work yet, because as of svn r3193 the console has a hardcoded json
request to '/mod_pagespeed_statistics' and in nginx we use '/ngx_...' .
I've tested this by changing all uses here to use the "mod_..." version and that
worked, but I've undone those changes.
2013-06-25 11:45:16 -04:00
Jeff Kaufman 84ff166375 trunk-tracking: update to r3193
* statistics_logging_file_prefix is gone, replaced with log_dir
* propagate a units fix from apache_system_test
* test nonces for critical css beaconing

Previous trunk-tracking was at 3162.  Diff of apache_system_test.sh:
  https://code.google.com/p/modpagespeed/source/diff?path=/trunk/src/install/apache_system_test.sh&format=side&r=3193&old_path=/trunk/src/install/apache_system_test.sh&old=3162
2013-06-24 15:03:54 -04:00
Maks Orlovich f8454d500a Update to match trunk as of 2003-06-17.
This matches two changes:
- Anupama made the caching tests use downstream_caching.html
(Thanks to her for help in updating this)
- Jan updated some configuration defaults, which made some images
compress more.
2013-06-17 14:42:36 -04:00
Anupama Dutta a421f6c501 caching: Sample proxy_cache_key construction.
Adding a nginx conf snippet for constructing a proxy_cache_key based on the UserAgent and expected optimizations for that UserAgent class, bypassing the cache for all other cases. Sample config for downstream-cache proxy_cache_key construction now takes care of 2 classes of UserAgents (expected to get most of the traffic for a site) and also bypasses cache for all other desktop UAs, all mobile UAs and all tablet UAs.

(Fixing the startup phase of the nginx server to put out the original error message in case of failure.)
2013-06-11 13:33:07 -04:00
Jud Porter a0fdf4b940 Fix add_instrumentation test. 2013-06-10 10:30:20 -04:00
Jeff Kaufman 8e76e14f4e caching: support for proxy_cache
Add support for proxy_cache integration with pagespeed with:

a) Handling cache-hit-header to bypass content handling by pagespeed.
b) pagespeed_test_conf.template with the proxy_cache configuration blocks.
c) System tests for checking hit and miss headers and purge requests.
d) Checking for proxy_cache_purge module during start-up for tests.

Squash-merge of Anupama's #404
2013-06-07 11:44:47 -04:00
Jeff Kaufman 2503f406b6 Merge branch 'master' into trunk-tracking 2013-06-06 14:18:08 -04:00
Anupama Dutta 9b7e2571bd Getting it working with mod_pagespeed (r3061).
Updating trunk-tracking to compile and work with mod_pagespeed svn revision 3061 with 2 small modifications to serf_url_async_fetcher.cc to disable SERF_HTTPS_FETCHING.

Please note that anyone building mod_pagespeed from source will need to
a) edit serf_url_async_fetcher.h to change the line "#define SERF_HTTPS_FETCHING 1" to have 0.
b) edit serf_url_async_fetcher.cc to move the definition of "apr_status_t status = APR_SUCCESS;" on line 265 to be inside the "#if SERF_HTTPS_FETCHING" block (in order to avoid a compilation error for psol/mod_pagespeed).

Highlights of this change:

1) Propagating renaming changes related to
  a) Furious -> Experiment
  b) ModPagespeed -> PageSpeed.
2) UrlPollableAsyncFetcher going away.
3) RewriteOptions now requiring a ThreadSystem parameter for construction.
4) Removing client_property_cache references and usages (since this was removed from mod_pagespeed).
5) Propagating beacon construction changes (where POST requests can now carry the url query param in the request).
6) General fixes for API/test breakages in statistics_logger, fallback property page cache,
2013-05-30 15:42:38 -04:00
Otto van der Schaaf e010be17a9 keepalive-tests: add more keepalive tests
- beacon get requests
- beacon post requests
- requests on /ngx_pagespeed_static
- requests on .pagespeed. resources
2013-05-29 17:09:04 +02:00
Otto van der Schaaf 8e1cbbf967 keepalive-test: Test that we handle keep-alive requests OK
Add a keepalive test which is repeated 100 times, with us both
behind the gzip filter and directly behind nginx's output filter.
The reason for that is that modules running after us can mask
our errors, this at least tests the most used ones.

This CL adds a failure to the expected failures, as currently,
this tests gives suspicious messages in nginx's error.log:
"client prematurely closed connection while sending response to client"

We should probably also test other code paths, like .pagespeed.
resources and the beacon with post requests as well. If this approach
is generally ok, I can proceed to add those as well.
2013-05-28 19:36:08 +02:00
Otto van der Schaaf 0d6eed588a option defaults: defaults for inode-limit & aris
A small change, but it would be good to make it early on.
These changes should probably be mentioned in the release notes.

Set these as hardcoded defaults:

FileCacheInodeLimit 500000
AvoidRenamingIntrospectiveJavascript on

Fixes https://github.com/pagespeed/ngx_pagespeed/issues/284
2013-05-13 13:44:17 +02:00
Jeff Kaufman d19dc5e6c6 Merge pull request #340 from pagespeed/oschaaf-gzip-and-etags
gzip-and-etags: prevent gzip from clearing our weak etags
2013-05-10 10:09:49 -07:00
Otto van der Schaaf 89a4c2e572 wget 204: disable keepalive instead of waiting a second in tests 2013-05-10 12:06:33 +02:00
Otto van der Schaaf 514117142f gzip-and-etags: prevent gzip from clearing our weak etags 2013-05-07 12:13:13 +02:00
Jeff Kaufman e4f87fd7ef beacons: serve as Cache-Control: max-age=0, no-cache 2013-05-02 17:45:15 -04:00
Jeff Kaufman e1341837ce system-test: critical css and lazyload_images-with-beaconing
Squash-merge of Jud's #303
2013-04-26 16:39:10 -04:00
Jud Porter 2e26e7a2fe Disable critical image beaconing in system tests. With this enabled image inline tests don't work, since only critical images will be inlined. 2013-04-26 15:26:17 -04:00
Jeff Kaufman 1426e918a8 system: roll back fd optimization 2013-04-26 15:26:16 -04:00
Jeff Kaufman 726271fdaa system-test: convert meta tags isn't expected to fail anymore 2013-04-24 09:01:10 -04:00
chaizhenhua d9abb1d666 Reduce fd usage, support convert_meta_tags
This reduced fd usage in NgxBaseFetch, and fixes support for convert_meta_tags

Fixes https://github.com/pagespeed/ngx_pagespeed/issues/56

Squash merge of chaizhenhua's https://github.com/pagespeed/ngx_pagespeed/pull/241

Conflicts:
	src/ngx_pagespeed.cc
2013-04-24 13:01:24 +02:00
Jeff Kaufman 5a84c5ea0a trunk-tracking: update tests off 1.5.27.1 r2845 2013-04-18 16:32:30 -04:00
Jeff Kaufman 82f7d27aa6 system-test: stop spewing files 2013-04-18 15:45:54 -04:00
Jeff Kaufman 336de7e512 tests: update tests to expect dns prefetching to work 2013-04-18 11:29:47 -04:00
Jeff Kaufman b8ba2006cd system-test: only run non-local stats test if hostname is set 2013-04-15 16:44:50 -04:00
Jeff Kaufman 637e0c8fb9 system-test: retain custom headers 2013-04-15 16:44:48 -04:00
Jeff Kaufman 60ba55064f system-test: experiment setup 2013-04-15 16:44:48 -04:00
Jeff Kaufman 66c177c3b2 logging: properly interpret google-style LOG() levels 2013-04-15 14:46:09 -04:00
Jeff Kaufman 41dad89ea1 system-test: disable the non-local access to statistics test 2013-04-13 10:09:47 -04:00
Jeff Kaufman 618fabfcb4 Merge pull request #254 from pagespeed/jefftk-blocking-rewrite
system-test: blocking rewrites
2013-04-12 15:05:59 -07:00
Jeff Kaufman 54431c1d15 native-fetcher: document and test native fetcher 2013-04-12 17:41:20 -04:00
Jeff Kaufman c3534acab1 system-test: dynamically defined url valued attributes 2013-04-12 17:11:33 -04:00
Jeff Kaufman 23ac08ca24 system-test: DomainRewriteHyperlinks 2013-04-12 17:09:43 -04:00
Jeff Kaufman 837e68b764 system-test: support XHeaderValue 2013-04-12 17:07:58 -04:00
Jeff Kaufman 4715993196 system-test: max cacheable content length 2013-04-12 17:06:29 -04:00
Jeff Kaufman 54572307c2 system-test: shm metadata cache 2013-04-12 17:05:05 -04:00
Jeff Kaufman b610bd9a41 system-test: forbid all disabled filters 2013-04-12 17:02:59 -04:00
Jeff Kaufman 34bb2bc711 system-test: forbidden filters 2013-04-12 17:01:24 -04:00
Jeff Kaufman d19a819acd system-test: cdn rewriting 2013-04-12 17:00:01 -04:00
Jeff Kaufman 4220739ada system-test: blocking rewrites 2013-04-12 16:54:07 -04:00
Jeff Kaufman 492ea96424 options: accept bad query parameters and request options
If we get invalid query parameters or request options we should treat it as if
there are no request-specific options instead of producing a 50x error.

Fixes #252.
2013-04-12 16:52:36 -04:00
Jeff Kaufman ecfcfc04d4 system-test: test connection refused in fetching 2013-04-12 16:50:56 -04:00
Jeff Kaufman 43b4b0768b statistics: check cache flushing 2013-04-12 16:48:51 -04:00
Jeff Kaufman 335282f334 readme: better php documentation 2013-04-12 11:13:17 -04:00
Jeff Kaufman f510a94214 statistics: check that statistics work and are not extrnally accessible
* Add tests for statistics.
* We weren't increasing resource_404_count on 404s.
  * This required giving `NgxBaseFetch` a `NgxServerContext` pointer.
* /ngx_pagespeed_statistics was publically available.
* Made a pass over the readme to add a new configuration option and fixed up
  serveral things that were out of date while I was there.

Fixes #248.
2013-04-11 13:03:30 -04:00
Jeff Kaufman 6b8ea5856c options: support options in urls via pagespeed AddOptionsToUrls
* Support AddOptionsToUrls
* Support tests that need top run something post cache flush
* Add `ps_determine_port` so we parse urls out of ports and fix #239
* Rejigger the tests to support how our headers for resources don't include a
  Content-Length header
2013-04-11 10:50:25 -04:00
Jeff Kaufman 41edcb97cd statistics: fix statistics and add a test so we don't break it again
If we get a request for `/ngx_pagespeed_statistics` we don't create a
`ps_request_context`.  We create the content properly, but then in the header
filter we assume that "ctx is NULL iff this is not a resource fetch" and so
conclude that we're not a resource fetch.  Then we call `CreateRequestContext()`
with `resource_fetch=false` and so it doesn't check to see if it's statistics.

Here I fix this by pulling the check for statistics outside of the
resource-fetch-only part of `CreateRequestContext()`.
2013-04-10 12:53:01 -04:00
Jeff Kaufman f3cc1a432e ssi: fix handling of server side includes
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.
2013-04-10 12:36:14 -04:00
Jeff Kaufman 255c2421f4 beacons: test beacons, stop segfaulting on beacons, also support valgrind
* Add test that we handle beacons.
* Fix a segfault in handling beacons.
 * This required switching NgxRequestContext to take an ngx_http_request_t
   instead of a ps_request_ctx.
* Support running tests under valgrind:

    USE_VALGRIND=true test/nginx_pagespeed_test.sh ...

But: we don't set a Content-Length header on our `204 No Content` response,
which makes wget wait for 60s to time it out.  Compare:

    wget --save-headers -O - http://localhost:8050/ngx_pagespeed_beacon
    curl -D- http://localhost:8050/ngx_pagespeed_beacon

The headers we send are:

    HTTP/1.1 204 No Content
    Server: nginx/1.2.4
    Date: Tue, 02 Apr 2013 21:07:02 GMT
    Connection: keep-alive

While Apache sends:

    HTTP/1.1 204 No Content
    Date: Tue, 02 Apr 2013 21:07:43 GMT
    Server: Apache/2.2.3 (CentOS)
    Content-Length: 0
    Content-Type: text/plain; charset=UTF-8

I can't get nginx to send a content length.  I've tried manually doing the
opposite of ngx_http_clear_content_length but that didn't work.  Asking on
nginx-devel I got:

    Adding a Content-Length will be inconsistent with RFC2616:

       The 204 response MUST NOT include a message-body, and thus is always
       terminated by the first empty line after the header fields.

I've reported a bug to wget.  For now we can just pass wget `-t 1 --timeout=1`.
2013-04-08 17:25:34 -04:00
Jeff Kaufman a5e4f46217 system-test: MapProxyDomain 2013-04-08 15:39:39 -04:00
Jeff Kaufman 2263dee2d7 system-test: proxy_pass with pagespeed disabled 2013-04-05 16:58:54 -04:00