How to force HTTP/1.1 in specific AJAX request

試著忘記壹切 提交于 2020-01-21 08:16:47

问题


Background: our server supports both HTTP/2 and HTTP/1.1 protocols.

However, during tests, it appeared that HTTP/1.1 is much faster for files upload. Example of that issue could be also seen here: Slow GCS upload speeds when using HTTP/2

Question: is it possible to force browser to make HTTP/1.1 AJAX request only for certain url/path? Internally we're using Axios (https://github.com/axios/axios).


回答1:


No this is not possible. HTTP/2 is a connection level setting that is negotiated by the browser as part of the HTTPS set up and cannot be overridden for certain AJAX calls nor set for particular paths.

The only way this would be possible would be to host this on a separate domain with a separate HTTPS certificate.



来源:https://stackoverflow.com/questions/52402640/how-to-force-http-1-1-in-specific-ajax-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!