-
Notifications
You must be signed in to change notification settings - Fork 385
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
Optimize hero images #5055
Comments
This is great. For added heuristics in the WordPress context, we may be able to use the same logic that is being used for lazy-loading images that landed in 5.5-beta: the |
Landed in AMP core: ampproject/amphtml#28672 AMP Toolbox Optimizer PR: ampproject/amp-toolbox#880 |
As discussed just now, let's also include the hero preloading logic detection for CSS background images that are defined with inline In the same way that a transformer is looking for One complication here is that an element with an inline CSS background could be tiny, and we'd have no way of using |
I am planning on adding a WP-specific transformer that is responsible for tagging the best images with the |
Feature description
The validator support for server-side rendering amp-img as img has been merged (cl/321463348). Would be great to also support this in the AMP WP plugin. As a reference on how to add it, you can find the AMP Optimizer integration here.
A few notes on the AMP Optimizer integration:
data-hero
attribute.srcset
is defined) and inject an img into the amp-img element (this also works for amp-iframe placeholders).loading=lazy/eager
(see Validator: Allow SSR for amp-img's img amphtml#29025 (comment)).//cc @westonruter @schlessera
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: