wp-media / wp-rocket

Performance optimization plugin for WordPress
https://wp-rocket.me
GNU General Public License v2.0
698 stars 217 forks source link

Support for Preconnect/Preload and 103 Early Hints #4433

Open markllego opened 3 years ago

markllego commented 3 years ago

Is your feature request related to a problem? Please describe. WP-Rocket should upgrade the DNS prefetching to preconnect and preload in order to utilize the 103 Early Hints.

Describe the solution you'd like Early Hints enable browsers to start preload before the main response is served. In addition, this can be used with other Resource Hints APIs like preconnect.

Link: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/early-hints.md

This will dramatically improve page load times and user experience.

Additional context

Example response header: Link: https://example.com; rel=preconnect, https://example.com; rel=preconnect; crossorigin, https://example.com/wp-content/themes/theme.css; rel=preload, as=style;

TokyoJump commented 3 years ago

I fully agree with you. This is a big problem.

https://github.com/wp-media/wp-rocket/issues/801 As he predicted, this is a problem.

CloudFlare provided Early HInts as a means of optimization, but in many cases it's not possible to add it. This is because currently users cannot add Link headers from function.php.

rayrutjes commented 2 years ago

Hey there,

Anybody has a workaround so we can start using Early Hints with WP-Rocket?

vipiny35 commented 2 years ago

Any update here, been waiting for too long now.

joaodath commented 1 year ago

Hey, WP-Rocket team! I was wondering if there are any updates to this feature request. It has the potential to improve loading times for many websites and I would love to see it land on the plugin soon <3

BradFD commented 11 months ago

W3 Total Cache adds link: rel=preload headers for its minified javascript files. How about adding similar to WP Rocket?

They look like: Link: </wp-content/cache/minify/r3e0dsj.js?x38494>; rel=preload; as=script