[wp-trac] [WordPress Trac] #42438: Add support for preload links (similar to resource hints)
WordPress Trac
noreply at wordpress.org
Wed Sep 5 22:00:08 UTC 2018
#42438: Add support for preload links (similar to resource hints)
------------------------------------------+-------------------------
Reporter: nico23 | Owner: swissspidy
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.0
Component: Script Loader | Version: 4.9
Severity: normal | Resolution:
Keywords: needs-unit-tests needs-patch | Focuses:
------------------------------------------+-------------------------
Comment (by westonruter):
For the preloading of images, this seems to be largely blocked by the
implementation [https://www.chromestatus.com/feature/5164259990306816
srcset and imgsizes attributes on link rel=preload] in browsers. Since
images in WordPress almost always get served with `sizes` and `srcset`, it
doesn't seem feasible to preload the image since we don't know which image
size will be used, and the browser could very well preload the wrong image
and waste bandwidth. In fact, when I tried adding preloading for the
header image in Twenty Seventeen, I got an warning in DevTools:
> The resource … was preloaded using link preload but not used within a
few seconds from the window's load event. Please make sure it has an
appropriate `as` value and it is preloaded intentionally.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42438#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list