HTTP/2 Server Push

问题:加载一个页面所需的资源,需要多次请求。例如加载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:不支持

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容