New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize handling of multiple references to the same image on a page at different sizes #198

Closed
GoogleCodeExporter opened this Issue Apr 6, 2015 · 7 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter
Copy link

GoogleCodeExporter commented Apr 6, 2015

If I have two sized img tags of the same image, mod_pagespeed will optimize 
each one separately resulting in two distinct URLs where previously there was 
one.

It would be better to serve the image once at its largest referenced size, and 
let the browser do the resizing to the smaller sizes.

Original issue reported on code.google.com by jmara...@google.com on 27 Jan 2011 at 7:32

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

We've made it tricky to work this into our current resource flow, since we need 
to decide the rewritten urls very early (before we even get the resources they 
correspond to).  We could, I suppose, do a pre-pass similar to the old "collect 
interesting urls to fetch them" pass, and use that to flag duplicated urls and 
their occurrence dimensions.

Original comment by jmaes...@google.com on 30 Jun 2011 at 9:57

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Changed to enhancement and lowered priority due to the difficulty of 
implementation and the lack of certainty about it being worthwhile: sending the 
image once is a win but making work for the browser is a lose. It's also 
unknown how common this situation is.

Original comment by matterb...@google.com on 9 Feb 2012 at 3:07

  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

We could use the property cache to remember all uses.

Consider:
   Flush Window #1 contains a 100x100 reference to an image.
   Flush Window #2 contains a 200x200 reference to the same image

The property-cache will help us know that we should optimize this image to 
200x200 and serve it in both img tags.

Original comment by jmara...@google.com on 17 Sep 2012 at 7:59

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

We shouldn't lose track of this, but it's a longer-term project.

Original comment by jmaes...@google.com on 11 Dec 2012 at 4:02

  • Added labels: Type-Defect
  • Removed labels: Type-Enhancement
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 10 Jun 2013 at 6:18

@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Using resize_rendered_image_dimensions should fix this issue.

Original comment by poojatan...@google.com on 23 Sep 2013 at 9:04

  • Changed state: Fixed
@GoogleCodeExporter

This comment has been minimized.

Copy link

GoogleCodeExporter commented Apr 6, 2015

Original comment by jmara...@google.com on 23 Sep 2013 at 9:05

  • Added labels: Milestone-v30, release-note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment