It made a significant difference to Google Fonts speed as well as Persona.
I'd definitely recommend using resource hints in your base HTML template or server controller, for the assets that you know every page will access. This is the low hanging fruit... making this super specific for each page likely won't fit into your CMS easily.
The browser can make sense of this, the browser can also make sense of not doing a DNS prefetch if it already has one in-flight for the preconnect, etc.
The gains are such that it is better to add the hints than not.
These hints can be placed inside the HTTP response header. A JavaScript API can only be used via `<script>`, which can only appear on the page (after the HTTP response has arrived).
14 comments
[ 3.0 ms ] story [ 47.6 ms ] threadYou'll see it as a HTTP header:
It made a significant difference to Google Fonts speed as well as Persona.I'd definitely recommend using resource hints in your base HTML template or server controller, for the assets that you know every page will access. This is the low hanging fruit... making this super specific for each page likely won't fit into your CMS easily.
The gains are such that it is better to add the hints than not.
[1] https://en.wikipedia.org/wiki/Irony_punctuation
Otherwise, why not just serve up a blank page which executes JavaScript to add characters one at a time?
Why isn't this MUST? Users absolutely have to have a choice, because prefetching (even just DNS) allows tracking ("analytics") information to leak.