这可能只是突出了我的一些误解,但我很好奇:
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模板网!
即使在调用 abort (jQuery) 之后,浏览器也会等待Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在调用 abort (jQuery) 之后,浏览器也会等待 ajax 调用
JavaScript innerHTML 不适用于 IE?JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不适用于 IE?)
XMLHttpRequest 无法加载,请求的资源上不存在“AXMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 无法加载,请求的资
XHR HEAD 请求是否有可能不遵循重定向 (301 302)Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 请求是否有可能不遵循重定向 (301 302))
NETWORK_ERROR:XMLHttpRequest 异常 101NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 异常 101)
XMLHttpRequest 206 部分内容XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分内容)