mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
feat(http2): push assets with single link header
less payload! https://blog.cloudflare.com/http-2-server-push-with-multiple-assets-per-link-header
This commit is contained in:
parent
0468c7997e
commit
bd54ddd2a7
@ -87,7 +87,9 @@ export async function render (req, res) {
|
||||
pushAssets.push(`<${href}>; rel=${rel}; as=${as}`)
|
||||
}
|
||||
}
|
||||
res.setHeader('Link', pushAssets)
|
||||
// Pass with single Link header
|
||||
// https://blog.cloudflare.com/http-2-server-push-with-multiple-assets-per-link-header
|
||||
res.setHeader('Link', pushAssets.join(','))
|
||||
}
|
||||
res.setHeader('Content-Type', 'text/html; charset=utf-8')
|
||||
res.setHeader('Content-Length', Buffer.byteLength(html))
|
||||
|
Loading…
Reference in New Issue
Block a user