incubator-pagespeed-mod
incubator-pagespeed-mod copied to clipboard
Optimize images in AMP
If PageSpeed sees <amp-img src=foo srcset=bar>
it currently doesn't optimize it by default. You can tell it to optimize the src
attribute by setting a UrlValuedAttribute
directive:
UrlValuedAttribute amp-img src image
but (a) this should be on by default and (b) you can't get it to optimize the srcset that way.
Any updates on optimizing the images inside the srcset
?
Any WordPress instance has this issue:
<img src="https://m.quicoto.com/wp-content/uploads/2017/01/xwp-image-110760650jpg.jpg.pagespeed.ic.ZQXNgOGGqF.webp" srcset="https://m.quicoto.com/wp-content/uploads/2017/01/wp-image-110760650jpg.jpg 2000w, https://m.quicoto.com/wp-content/uploads/2017/01/wp-image-110760650jpg-768x768.jpg 768w, https://m.quicoto.com/wp-content/uploads/2017/01/wp-image-110760650jpg-1024x1024.jpg 1024w" sizes="(max-width: 2000px) 100vw, 2000px">
src
is being optimized but not the srcset
so user who has a modern browser never uses the optimized version.
What version of PageSpeed are you using? This should be working with 1.12
@jeffkaufman I've run
apt-get update
apt-get upgrade
Everything is up to date. Is there a command or file where I can check the pagespeed version?
Thank you.
If you're on mod-pagespeed-stable then upgrading with apt-get will leave you at the most recent stable release, which is still 1.11 (currently).
To check what version you're running, the easiest way is to go to https://ismodpagespeedworking.com/ (not run by the pagespeed team, but pretty useful!) and see what it shows for the X-Mod-Pagespeed
header. For example, for modpagespeed.com I see X-Mod-Pagespeed: 1.12.34.1-0
.
Thanks for the reply @jeffkaufman
It's odd. I enter my domain https://m.quicoto.com/ but it says no mod_speed detected but I clearly have it installed and it is optimizing the HTML. Maybe I have such and old version that it doesn't set the headers? 🤔
When I manually load the headers for your site I see X-Mod-Pagespeed: 1.11.33.5-0
, which is our latest stable version. I'm not sure why ismodpagespeedworking.com
doesn't see the same headers.
If you want to stay on the stable track we're planning to re-release 1.12 as stable pretty soon. Or you can switch to beta; either works.
@jeffkaufman I'll stay on stable. Thanks again. Keep up the good work.
Hi Still here this issue, with a master branch build (10/6/2019). src in amp-img are optimized but srcset not. I have this UrlValuedAttribute amp-img src image in config file.