这可能只是突出了我的一些误解,但我很好奇:
This may just highlight some misconception of mine, but I was curious:
如果您正在运行 HTTP/2 服务器并希望在浏览器中向服务器发出 XHR 请求,XHR 会自动利用标头中的性能优化以及它提供的性能优化吗?
If you had an HTTP/2 server running and wanted to make XHR requests in the browser to the server, would XHR automatically take advantage of the performance optimisations in headers and such that it provides?
还是会忽略该功能并作为 HTTP 请求运行?如果是这样,我们可以做些什么来在我们的请求中使用新的优化?
Or would it ignore that functionality and operate as an HTTP request? If so, are there any things we can do to use the new optimisations in our requests?
你不需要做任何事情.如果服务器支持 HTTP/2,XHR 将使用它.标头压缩等会自动启动.
You don't need to do anything. If the server supports HTTP/2, XHR will use it. Header compression and such will kick in automatically.
测试一下:
这篇关于当前的 XHR 实现是否利用了 HTTP/2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!