-
Notifications
You must be signed in to change notification settings - Fork 25
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
Transformer: Preload images #11
Comments
In the WordPress plugin, I think this should include:
However, it gets complicated for images that have More resources:
This is only supported by Chromium-based browsers as far as I know. |
The tricky part here is not to take away bandwidth from more critical resources (e.g. v0.js). The AMP Cache team is currently working on a (single) hero image identification heuristic. Once this has been done, we should port it to AMP Optimizer and WP. |
Identifying the hero image should be relatively straightforward in WordPress as it is normally the featured image that has been selected for a given post. |
That's perfect of course, is this always going to be an image in the first viewport? |
Not necessarily, as a theme may also select a header image and a custom logo. But the featured image would be the most important image in the first viewport. Here's a fairly typical scenario for images on a theme: My face is the custom logo. The plants on the table are the header image. And the cloudy skyline is the post's featured image. Themes will differ in how they arrange these in a template, but they are often all visible in the first viewport. |
Closely related to #10 which is for adding |
I'm not sure this should still be included, given the work that the |
Given the |
Feature description
Add a new transformer
BrowserHints
that adds browser hints as meta tags to the<head>
node. The initial implementation should add the following hint:preload
hint for the first X images in the pageThe number X should be configurable by the user and default to 5.
Related ampproject/amp-wp#4213
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
<head>
element contains<link rel=preload ...>
elements pointing to the first few imagesDemo
Changelog entry
The text was updated successfully, but these errors were encountered: