Reduce server hits with JS history API#17
Reduce server hits with JS history API#17peterwilsoncc wants to merge 2 commits intopfefferle:masterfrom
Conversation
This reduces the number of calls to the server to speed up content loading for the user.
|
I'm all for making this kind of thing possible, but am hesitant to make it the default behavior. While it should work fine for browsers, I'm not sure what the implications would be for search engines, since you now have two URLs serving identical content with So if we need to add the |
|
Makes sense, I'll update the patch & add a comment when I've done so. WP adds canonical meta tags for big search, but I didn't think about the other use cases. Sent from my mobile phone
|
|
I think an action to replace the default redirect still makes sense. There are two options:
What do you think? |
|
Yeah. I haven't had a chance to work on this but coincidently going on a WP dev weekend this weekend so will add it to the list :) |
|
I'm fine with either of @pfefferle's options (you guys pick). I would also note however that the overhead of returning a 301 redirect and making a second HTTP request should be completely negligible with HTTP/2. |
This patch aims to speed up page loads by removing the extra hit required by a 301 redirect.
The patch loads the requested page/post on the shortlink, the JavaScript
history.replaceStatefunction is used to display the canonical URL to the visitor.Individual results may vary but on my server it looks like it will save around 500ms.