theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
109 stars 8 forks source link

Add preconnect http header to first served doc #2355

Closed brendanheywood closed 6 years ago

brendanheywood commented 7 years ago

https://www.igvita.com/2015/08/17/eliminating-roundtrips-with-preconnect/

https://w3c.github.io/resource-hints/

Preconnect pre-emptively saves a few round trips on subsequent dependant resources like static and possible other resources like google maps. It only has value on cold cache loads and only has value when served on the initial document, and when the header is flushed as soon as possible and not sent along with the main html document.

This would have no value on subsequent pages or requests so adding to cgi or avatars would be pointless, just templates is perfect.

It can't be sent before a redirect so we can only apply this to places where we know we will never redirect (should be OK as most or all template pages are anon?), or at least after any redirect logic is applied.

scd commented 7 years ago

The target pages we should consider using this method would be ones where google are referring to us:

home page area pages route pages articles

We have to make sure all redirects are determined before we lookup these pages. For example, what happens if we look up a merged page?

Will this make a difference on how fast the page seems to google index bots?

brendanheywood commented 7 years ago

For merged pages don't we add an alternate url stub which means both URLs serve and there is no redirect?

I suspect google regularly tests with both cold and warm cache. So yes this will effect their cold cache scrapes, Google invented this spec

brendanheywood commented 6 years ago

This has been done for a while, but just added a second hint for image.thecrag.com for next release too