-
Notifications
You must be signed in to change notification settings - Fork 55
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
SSR all amp-img tags to img (not just the hero images) #465
Comments
This sounds good. I think we can add |
/tryassign @jridgewell |
I've assigned this issue to |
The C++ transformer already removes SSR'd |
honeybadgerdontcare
pushed a commit
that referenced
this issue
Oct 20, 2020
97% (and growing) of Chrome browsers that support SXG also support loading=lazy. We still prioritize (via preload and loading=eager img) hero images. Requires transforming with Version 5. Re: #465 PiperOrigin-RevId: 336760832
twifkak
pushed a commit
that referenced
this issue
Oct 21, 2020
97% (and growing) of Chrome browsers that support SXG also support loading=lazy. We still prioritize (via preload and loading=eager img) hero images. Requires transforming with Version 5. Re: #465 PiperOrigin-RevId: 336760832
Is there anything left to do on this (besides e2e testing)? |
No, I think that's it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jridgewell's http://cl/327496988 (c/o #466) converts hero images from
amp-img
toamp-img > img
and addslink rel=preload
.In addition, for SXG, we should convert all
amp-img
s on the page toamp-img > img[loading=lazy]
(but not preload them). Thus, all images above the fold can be fetched and decoded before full layout, but at a lower priority than hero images.Example: https://jsfiddle.net/Ln9yejr3/show
This is particular to SXG-optimized AMP, because
loading=lazy
isn't implemented in all browsers that AMP targets, but it is implemented in almost all browsers that support SXG. (~3% of Chromium browsers are 73-75.)As a precondition to this change, SXG-supporting AMP caches should remove the non-hero
img
tags when retransforming for unsigned use (which includes a higher fraction of non-loading=lazy-supporting browsers), so that the prerender network usage is the same as non-SXG AMP.Moving discussion from ampproject/amphtml#29025 (comment). /cc @sebastianbenz @cramforce @jridgewell
The text was updated successfully, but these errors were encountered: