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

Allow UrlValuedAttribute:image on elements with children #1308

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

Allow UrlValuedAttribute:image on elements with children #1308

ypmict opened this issue May 13, 2016 · 1 comment

Comments

@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
Copy link
Contributor

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/incubator-pagespeed-mod that referenced this issue Jun 9, 2017
ashishk-1 added a commit to ashishk-1/incubator-pagespeed-mod that referenced this issue Jun 13, 2017
ashishk-1 added a commit to ashishk-1/incubator-pagespeed-mod that referenced this issue Jun 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants