Although there are some caveats using streaming in SSR.
It's still possible to stream some important tags in the <head> section, such as:
<link rel="dns-prefetch"> tags<link rel="preconnect"> tags<link rel="prefetch"> tags<link rel="preload"> tagsMaybe even more, such as default layout and theme styles.
This will improve page loading time since the browser has more time to preconnect, preload and prefetch connections and resources.
Seems like "preconnect" works that way:
nuxt.config.js:
link: [
{
rel: "preconnect",
href: "https://cdn.domain.com/",
crossorigin: true
}
]
Other tags I have not tested
Seems like "preconnect" works that way:
nuxt.config.js:
link: [ { rel: "preconnect", href: "https://cdn.domain.com/", crossorigin: true } ]Other tags I have not tested
Yes, that's true. I actually mean that the Vue Server Renderer sends that information before rendering the page. So that the browser has a additional +- 500ms to preconnect, prefetch and to do other stuff (depending on the SSR performance of your project).
Will also improve Time to First Byte. Which is a test factor for Lighthouse, which implies that it might also be one of the many (in)direct ranking factors of Google Search, although Google states they did not do so.
Overall it would help Pagespeed, and therefore CTO, and therefor also SEO.
Streaming SSR might be difficult. Even for the head, because head functions from components can change it.
Progressive hydration might not improve the TTFB but the TTI and input latency.
There ishttps://github.com/maoberlehner/vue-lazy-hydration / https://github.com/znck/lazy-hydration for that 鈽猴笍
I've never tried it, but you should also be able to do much (if not all) of these as http headers. That may make them a tick faster.
example: https://developer.mozilla.org/en-US/docs/Web/HTTP/Link_prefetching_FAQ
Most helpful comment
Streaming SSR might be difficult. Even for the head, because
headfunctions from components can change it.Progressive hydration might not improve the TTFB but the TTI and input latency.
There ishttps://github.com/maoberlehner/vue-lazy-hydration / https://github.com/znck/lazy-hydration for that 鈽猴笍