V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
httpbin - 协议调试工具
httpstatuses - 协议状态码查询
httpie - cURL-like tool for humans
Fiddler
litchinn
V2EX  ›  HTTP

关于 nginx 配置 http2 的 server push 的疑问

  •  
  •   litchinn · 2021-02-26 14:43:57 +08:00 · 1095 次点击
    这是一个创建于 1148 天前的主题,其中的信息可能已经有所发展或是发生改变。

    例如 vue 项目打包后,在 /js 或者 /css 包中有许多资源,想通过 server push 直接推给浏览器,那么改如何写配置呢? nginx 官方说:

    Pre-emptively sends (pushes) a request to the specified uri along with the response to the original request. Only relative URIs with absolute path will be processed, for example:

    http2_push /static/css/main.css;

    The uri value can contain variables.

    uri 可以包含变量,这里的变量是怎么个写法呢,是指“*”这样的匹配方式吗,能将 /js 或 /css 中的部分资源进行推送吗?

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2735 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 02:05 · PVG 10:05 · LAX 19:05 · JFK 22:05
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.