incubator-pagespeed-mod icon indicating copy to clipboard operation
incubator-pagespeed-mod copied to clipboard

Add srcset as a possible category for UrlValuedAttribute

Open weberdigital opened this issue 6 years ago • 10 comments

In some cases, we need to put srcsets for image into a custom attribute, such as data-srcset.

Unfortunately, those images cannot be optimized with ModPagespeed at the moment. Adding the configuration ModPagespeedUrlValuedAttribute img data-srcset image does not work, as data-srcset does include both the image url as well as the image size. Thus, it would be nice if there was a dedicated category for srcsets in for the UrlValuedAttributes.

weberdigital avatar Dec 19 '18 12:12 weberdigital

Same as nginx #1608

Lofesa avatar Dec 24 '18 10:12 Lofesa

Hi @oschaaf Yes, is a improvement, like data-src work as img category. As you know, I´m not a developer but I think most of the work is done as is the same issue as srcset label. Perhaps an other issue/improvement with the lazyload_images filter because it load images in onload event, no matter if LazyloadImagesAfterOnload is set to on or off and Pagespeed Insigths don´t recognize that images are lazyloaded. Because of that I´m using a wordpress plugin based on lazysizes that need data-src and data-srcset

Lofesa avatar Jan 11 '19 11:01 Lofesa

Hi @oschaaf. Brilliant that you seem to be working on this. Does it require further testing?

andymathieson avatar Oct 28 '19 11:10 andymathieson

Hi @andymathieson Sure, none of us take care of all use cases. This PR is a transient one. The definitive PR is pending to commit. I have it in production, so it works. But my site is a small web, maybe some use cases are not covered.

Lofesa avatar Oct 28 '19 11:10 Lofesa

@Lofesa Thanks for the reply. We require the data-srcset capabilty so will probably fire up a test server and give it a spin. Hopefully will be commited to master soon as I'm sure this is a highly needed feature.

andymathieson avatar Oct 28 '19 11:10 andymathieson

Hi @andymathieson If you fire a test server, apply the PR #1929 , the definitive pacht to solve the issue. This PR solves data-srcset, amp img srcset and add a UrlValuedAttibute srcset category, so you can use others elements: ModPagespeedUrlValuedAttribute img data-wpfc-original-srcset srcset

Lofesa avatar Oct 28 '19 12:10 Lofesa

Hi @Lofesa Will this patch be merged into the master anytime soon in the future?

andymathieson avatar Nov 21 '19 10:11 andymathieson

Hi @andymathieson I don´t know when the patch be merged and when a new release that include it be libered. Maybe @oschaaf can say some about this.

Lofesa avatar Nov 21 '19 10:11 Lofesa

It's been almost a year without any response.

Any updates? @oschaaf

Jacobs63 avatar Nov 04 '20 15:11 Jacobs63

Please provide updates will this be merged to master ?

vanushwashere avatar Jan 11 '21 09:01 vanushwashere