Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Resource regeneration doesn't respect custom options #457

Closed
GoogleCodeExporter opened this issue Apr 6, 2015 · 5 comments
Closed

Resource regeneration doesn't respect custom options #457

GoogleCodeExporter opened this issue Apr 6, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

Setup:
 - Set jpeg recompression quality to 
   default to 10.
 - Set jpeg recompression quality to 50
   for an images directory.
 - Set jpeg recompression quality to 100
   for an html directory.
 - Reference a jpeg in that images
   directory from an html file in that
   html directory.

When you load the html file it will rewrite the jpeg with the options from the 
html directory, quality 100.  If the image falls out of cache or, in a 
multi-server environment, is requested from different server, it will be 
regenerated using the specified default quality 10.

If there were another html directory with jpeg-quality set to 75, for example, 
this would be even messier.

At no point will the recompression quality of 50 be used.

The problem is that there are several options that affect filter application 
without changing the url, so mod_pagespeed can't always generate the resource 
correctly from just the url.  Making the url contain all of this information 
would be possible, but it would also mean that any time we added a filter than 
could be adjusted on a per-directory basis we would need to expand the urls and 
that they might become too long.

Because this is not a common configuration for mod_pagespeed and even then this 
bug would rarely surface in a single-server setup, it may not be very serious.  
But if you're using mod_pagespeed for multiple sites and you want to have 
different filter-options for different ones this might be a real problem.

One fix would be, as described above, expanding the urls to contain all 
information necessary to generate a resource.  Another would be to modify the 
resource flow to support custom options, in which case this bug would stop 
being a problem for a setup where mod_pagespeed is used for multiple sites with 
different filter-options.

(Warning: none of this has been experimentally tested; it's all based on 
reading the code for handle_as_resource which does not support custom options 
(unlike InstawebContext::InstawebContext(), which does.).)

Original issue reported on code.google.com by jefftk@google.com on 3 Jul 2012 at 8:33

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant