[wp-trac] [WordPress Trac] #39695: Add preload headers in redirects
WordPress Trac
noreply at wordpress.org
Wed Jan 25 22:09:46 UTC 2017
#39695: Add preload headers in redirects
-------------------------+-----------------------------
Reporter: onnimonni | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
http2 push enabled servers can immediately push linked assets or documents
for the client. This saves clients from one round-trip.
At the moment at least Cloudflare and h2o web server can http2 server push
assets defined in Link headers: https://www.w3.org/TR/preload/#server-
push-http-2.
I believe more will follow in the next few years. WordPress powers so much
of the web that it's our responsibility to try to make it as fast as we
can.
This is usually quite hard topic because we have no idea what is stored in
the client browser cache.
We can start implementing the Link preload headers in internal redirects
because in that situation it's quite obvious that the client wants to make
that request as their next one.
This is what I want to achieve
{{{
$ curl --http2 -i https://wordpress.test/wp-admin/
HTTP/2 302
...
Location: https://laextra.test/wp-
login.php?redirect_to=https%3A%2F%2Flaextra.test%2Fwp-admin%2F&reauth=1
Link: </wp-login.php?redirect_to=https%3A%2F%2Flaextra.test%2Fwp-
admin%2F&reauth=1>; rel=preload; as=document
}}}
I created a patch which adds these headers automatically in
'''wp_redirect()''' function.
Links about http2 server push:
https://blog.cloudflare.com/announcing-support-for-http-2-server-push-2/
https://h2o.examp1e.net/configure/http2_directives.html
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39695>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list