pagespeed resources served with chunked encoding #712
Comments
working on this now |
@jeffkaufman I just saw you are looking at this as well - I'll pick something else. |
This is also a problem in trunk, so I'm debugging it there. Currently writing a test to reproduce, though I see it with manual testing already. ngx_pagespeed trunk-tracking is currently one commit ahead of PSOL trunk because @xqyin accidentally committed #709 before pushing to PSOL svn, so to build trunk-tracking right now you need to roll back off 96f185d. This should be fixed soon. But if you do want to look at 1.8.31.2 the psol version to use is the one tagged for the release: |
Here's a test to reproduce it:
|
When serving |
Sorry about that, but I pushed to PSOL svn yesterday, I think. On Thursday, May 29, 2014, Jeff Kaufman notifications@github.com wrote:
|
In this case we currently call on the base fetch Either PSOL needs to be setting the content length, which it's not doing so, or ngx_pagespeed needs to wait after it gets |
For some pagespeed resources the content length is set properly: In these cases |
@jeffkaufman Your analysis makes sense to me, setting the CL early when possible sounds good. |
I'm not sure I totally understand, but the incorrect hash triggers fallback rewriting, and in fallback rewriting we weren't properly clearing the content type before r3996. 1.8.31.2 doesn't have that change, though we're including it in 1.8.31.3. |
On the cache extension path we don't store the rewritten resource (only the input resource) while on all the other paths we do. Perhaps the content length isn't populated when we load from a rewritten resource? |
This code ( |
Calling |
|
And if I'd read a little more I would have seen it. That's not
Which is exactly what we're seeing: no content length in cases where the output_resource is not in cache. |
Current best guess: |
This fixes it. I'll make the PSOL change. |
Fixed with PSOL r4021. |
If I install 1.8.31.2 and fetch
http://localhost:8050/mod_pagespeed_example/styles/A.rewrite_css_images.css.pagespeed.cf.HASH.css
I will get aContent-Length
header and the expectedCache-Control: private
. If instead I fetch it with the correct hash [1] I getTransfer-Encoding: chunked
and the expectedCache-Control: public ...
. We have a test that's supposed to be making sure we always sendContent-Length
, but it's not catching this because it uses a fake hash.[1] get this with
curl -s 'http://localhost:8050/mod_pagespeed_example/rewrite_css_images.html?PageSpeedFilters=rewrite_css' | grep rewrite_css_images | awk -F'"' '{print $(NF-1)}'
The text was updated successfully, but these errors were encountered: