美文网首页
HTTP/2 Server Push

HTTP/2 Server Push

作者: 猫侠 | 来源:发表于2017-06-09 09:43 被阅读0次

问题:加载一个页面所需的资源,需要多次请求。例如加载index需要请求三次:index.html、index.js、index.css。

解决思路:Server在接收到加载index请求时,同时返回index.html、index.js、index.css。

Client:

Link: </css/styles.css>; rel=preload; as=style, </js/scripts.js>; rel=preload; as=script, </img/logo.png>; rel=preload; as=image

Server
Apache: FilesMatch、H2PushResource
Nginx:不支持

相关文章

网友评论

      本文标题:HTTP/2 Server Push

      本文链接:https://www.haomeiwen.com/subject/nxoczttx.html