Commit Graph

217 Commits

Author SHA1 Message Date
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
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
Jeff Kaufman adcfac1570 system-test: check whether we work with php 2013-04-05 11:02:17 -04:00
Jeff Kaufman d41574edb5 system-test: respect custom options on resources 2013-04-05 11:00:57 -04:00
Jeff Kaufman c939112a9b system-test: check cache_partial_html and flush_subresources do nothing 2013-04-05 10:59:16 -04:00
Jeff Kaufman 001882a57e system-test: check for valid xhtml in add_instrumentation js insertion 2013-04-05 10:57:47 -04:00
Jeff Kaufman c14cd3f4f4 system-test: avoid renaming introspective javascript 2013-04-05 10:56:31 -04:00
Jeff Kaufman 615e7651e2 system-test: check that combine_js works with long urls 2013-04-05 10:54:56 -04:00
Jeff Kaufman 0f0c1cb162 caching-headers: respect 'ModifyCachingHeaders off' 2013-04-05 10:53:44 -04:00
Jeff Kaufman 957ef3b2c1 system-test: check LoadFromFile works 2013-04-05 10:51:45 -04:00
Jeff Kaufman 443384797d system-test: shard domain
* Test ShardDomain
* Improve error message when options cannot be set at location scope
** Used to say `"pagespeed" directive Option cannot be set at location
   scope`, now says `"pagespeed" directive "ShardDomain" cannot be set
   at location scope`.
* Marked `CustomFetchHeader`, `MapOriginDomain`, `MapProxyDomain,
  `MapRewriteDomain`, and `ShardDomain` as legal to set in location
  blocks.  In `mod_instaweb.cc` they're listed under `All two parameter
  options that are allowed in <Directory> blocks`.
2013-04-05 10:49:52 -04:00
Jeff Kaufman ee6f44ee67 system-test: check that we respect the Vary: User-Agent 2013-04-05 10:47:29 -04:00
Jeff Kaufman 465594c5a6 system-test: check jpeg and webp rewriting quality 2013-04-05 10:41:07 -04:00
Jeff Kaufman 70c74813c0 system-test: check rewriting images works 2013-04-04 10:57:02 -04:00