我将nginx1.18配置为使用预加载来推送图像。
This i the nginx configuration
location / {
proxy_pass http://miosito;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
http2_push_preload on;
}
}这些是curl从后端获得的http头。
HTTP/1.1 200 OK
Content-Type: text/html;charset=UTF-8
Cache-Control: no-cache,no-store
Expires: Thu, 17 Apr 1971 01:00:00 GMT
Link: ; as="image"; rel="preload"
Content-Length: 4440
Date: Thu, 3 Nov 2022 09:57:57 GMT这是Chrome 铬开发工具结果的结果
该页面为联机这里。
看来,http2 push的工作方式并不是完全相同的。有什么建议吗?
发布于 2022-11-03 22:36:21
目前版本的Google不再支持HTTP/2 push。这是因为它的好处是值得怀疑的,而且可能是有益的执行是非常困难的。
https://developer.chrome.com/blog/removing-push/有关于这个主题的更多细节。
https://serverfault.com/questions/1114721
复制相似问题