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

Allow UrlValuedAttribute:image on elements with children #1308

Closed
ypmict opened this Issue May 13, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@ypmict
Copy link

ypmict commented May 13, 2016

Hi,
I opened a new issue that is related by issue #1297
That is by using the syntax :

ModPagespeedUrlValuedAttribute li data-thumb image

the image ended up duplicate in the html just like what Mr. @oschaaf said in the original issue post

Thank you very much

@jeffkaufman

This comment has been minimized.

Copy link
Contributor

jeffkaufman commented Jun 27, 2016

Reproduced. If you configure a site to be:

<li data-thumb="a.jpg">
  <img src="a.jpg">
</li>

And you set in your config:

ModPagespeedUrlValuedAttribute li data-thumb image

Chrome gets:

<li data-thumb="a.jpg.pagespeed.ce.O58zxI4ffb.jpg">
<img src="xa.jpg.pagespeed.ic.hq49LFhoZa.webp">
</li>

That is, <li data-thumb=...> just gets cache-extended, while <img src=...> gets fully optimized. On the other hand, if you have:

<li data-thumb="a.jpg"></li>
<img src="a.jpg">

Then you get the expected:

<li data-thumb="xa.jpg.pagespeed.ic.hq49LFhoZa.webp"></li>
<img src="xa.jpg.pagespeed.ic.hq49LFhoZa.webp">

Going from memory, the problem is that any tag that has children isn't considered an acceptable target for image optimization, so it only gets cache-extension here. I'm not sure why we have this limitation, but it should be fixable.

I've added this to the Work Prioritization sheet.

@jeffkaufman jeffkaufman changed the title Using ModPagespeedUrlValuedAttribute made a duplicate image load problem Allow UrlValuedAttribute:image on elements with children Jun 27, 2016

ashishk-1 added a commit to ashishk-1/mod_pagespeed that referenced this issue Jun 9, 2017

ashishk-1 added a commit to ashishk-1/mod_pagespeed that referenced this issue Jun 13, 2017

ashishk-1 added a commit to ashishk-1/mod_pagespeed that referenced this issue Jun 15, 2017

@oschaaf oschaaf closed this in 0d9cf29 Jun 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment