gpt4 book ai didi

Magento 2 : Enabling http2_push with Nginx frontserver and varnish(Magento 2:使用Nginx FrontServer和varish启用HTTP2_PUSH)

转载 作者:bug小助手 更新时间:2023-10-28 10:12:48 26 4
gpt4 key购买 nike



I am trying to implement http2_push to get the css sent with all the pages. Here is my sample code. I dont see the css being pushed yet. What am i doing wrong. Http2 is enabled.

我正在尝试实现HTTP2_PUSH,以获得与所有页面一起发送的CSS。以下是我的样例代码。我还没有看到css被推向市场。我做错了什么。Http2已启用。


 location / {
#add_header Set-Cookie "session=1";
#add_header Link $push_resources;
proxy_pass http://xx.xxx.xxx.xx:6081;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Port 8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Country $geoip_country_code;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/styles-l.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/StripeIntegration_Payments/css/wallets.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/Magefan_Blog/css/blog-custom.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/Magefan_Blog/css/blog-m.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/footer.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/font-awesome.min.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/header.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/archigrafix.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/navigationmenu.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/theme.min.css;
http2_push /pub/static/frontend/Archigrafix/basic/en_US/css/styles-m.css;

}

更多回答
优秀答案推荐

Nginx removed push support in 1.25.1: https://forum.nginx.org/read.php?2,297538

NGINX在1.25.1中删除了推送支持:https://forum.nginx.org/read.php?2,297538


As did Chrome for reasoned explained in this post (full disclosed, I authored this Chrome post):
https://developer.chrome.com/blog/removing-push/

正如Chrome for reasoned在这篇文章中所解释的那样(完全披露,我撰写了这篇Chrome文章):https://developer.chrome.com/blog/removing-push/


General consensus is that HTTP/2 Push is too difficult to get right and shouldn’t be used.

普遍的共识是,HTTP/2推送太难正确使用,不应该使用。


更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com