-
Notifications
You must be signed in to change notification settings - Fork 155
RespectVary ignored when cache-extending #1373
Comments
@eljoest Could you post the html source you receive when you also turn on the debug filter?: |
Sorry for the long delay, the relevant section shows:
|
I just tried reproducing this naively on a test site, and I do see images getting rewritten to be cache extended:
Copying
The problem isn't that PageSpeed can't fetch the image or something, since it's able to tell that it doesn't need resizing, and that it's too large to inline. Additionally, when fetched from Chrome it can make a webp:
If I load your page with
Copying the full tag also doesn't fix it:
I'm at a bit of a loss. Is there anything mentioning this image in your apache log file? |
How good are the original caching headers? If it's already cacheable for at On Wed, Aug 24, 2016 at 3:10 PM, Jeff Kaufman notifications@github.com
|
The origin response headers, with
Normal mime, max-age isn't that far out. |
It is something about the headers, though! If I set up my local server with:
And reference the image directly:
Then I get Very strange! |
reproduced locally with netcat; now trying to find out which headers are responsible |
It's the If I have no If I have If I have an unknown |
I'm guessing this is something weird about how |
@jeffkaufman Thanks a lot for the thorough analysis. I have removed |
Reproduced this locally:
Add to
Now see that it's not optimized normally:
But we'll still turn it into a webp:
And we don't actually have to start with an optimized image; it's enough to ask about cache-extension:
So: it looks like it we have a resource with a |
Here's a unit test that captures this:
|
To decide whether it's ok to cache-extend, |
So the problem is that in cache extending we ignore the |
All the calls to the zero-arg version of |
Cases to fix:
|
Yes, it's a bug, and I'm working on a patch. Thanks for reporting this! |
quick question -- should we get rid of the zero-arg version of On Thu, Aug 25, 2016 at 4:04 PM, Jeff Kaufman notifications@github.com
|
By default we don't respect Vary headers we find on resources. People who do want us to respect them can set 'RespectVary on' in their configuration. The cache-extender was not considering the value of the RespectVary option in deciding whether things were cachable, and was instead assuming RespectVary=true. Fixes #1373
By default we don't respect Vary headers we find on resources. People who do want us to respect them can set 'RespectVary on' in their configuration. The cache-extender was not considering the value of the RespectVary option in deciding whether things were cachable, and was instead assuming RespectVary=true. Fixes #1373
@jmarantz The zero-arg version makes sense in the places it's still being used: (1) tests and (2) handling resources pagespeed creates (where respect-vary shouldn't apply). |
X-Mod-Pagespeed: 1.11.33.2-0 on apache
I'm seeing partial rewrites of the HTML src attributes.
The issue can be reproduced with the request parameters
?ModPagespeed=on&ModPagespeedFilters=extend_cache,rewrite_images
but also happens with the production filters:
Original headers of the various images don't differ regarding cache info. This one fails but can't be compressed further:
This one works but is getting reduced to 6204 bytes:
In mod_pagespeed_message I can see:
The text was updated successfully, but these errors were encountered: