有没有为什么多部分HTTP响应不普遍支持在浏览器中一个事实上或成立的原因吗? [英] Is there a de facto or established reason why multipart HTTP responses aren't generally supported in browsers?

查看:121
本文介绍了有没有为什么多部分HTTP响应不普遍支持在浏览器中一个事实上或成立的原因吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTTP协议已经支持了很久多部分响应。我以前用过它们用于适当配备的消费者的API,但它不会出现浏览器的支持对他们来说是很不错的,也没有在过去的五年里提高。我已经很难找到关于这可能是为什么很多信息。我很想能够通过发送所有我认识的一个web应用程序将需要对初始请求的资产,特别是对于采用像Backbone.js的客户端应用程序的框架,以减少HTTP请求。​​

The HTTP protocol has supported multipart responses for a long time. I've used them before for APIs with appropriately equipped consumers, but it doesn't appear browser support for them is very good, nor has it improved in the last half-decade. I've had difficulty finding much information on why this might be. I'd love to be able to cut down on HTTP requests by sending all of the assets I know a webapp will need on the initial request, especially for apps that employ client-side frameworks like Backbone.js.

是否有任何的白色纸张,贸易文章,失败的实验,或者为什么没有浏览器的制造商或网络性能的传道者支付这个长期HTTP建造任何关注?

Are there any white-papers, trade articles, failed experiments, or other evidence on why neither browser-makers or web-performance evangelists are paying this long-time HTTP construct any attention?

要彻底清楚,我不是在寻找一个意见,但真正的证据表明这可能是为什么。例如,如果Mozilla的几年前出版的一些关于这一点,或者没有在Firefox的bug跟踪系统封闭票在哪里,为什么他们就不会实现这个的首席开发人员的意见。

推荐答案

其实旧版本的IE将处理多部分的应用程序/八位字节流的响应和下载操作过程中保存的所有文件,但是这个最近被移除(为IE7 ,我认为),并具体到只下载。

Actually older versions of IE would process multipart application/octet-stream responses and save all the files during a download operation, but this was recently removed (as of IE7, I think) and was specific to downloading only.

我怀疑你会找到证据你要找的,因为我不认为你提出的是与HTTP规范的精神是一致的。我会尽量解释什么,我的意思了。 HTTP的基本模式是一种客户驱动的请求和服务器的这一请求的响应。但你似乎是提出该服务器将返回在假设客户会知道如何处理他们做任意文件。

I doubt you're going to find the "evidence" you're looking for, because I don't think what you have proposed is in keeping with the "spirit" of the HTTP specification. I will try to explain what I mean by that. The basic paradigm of HTTP is a client-driven request and the server's response to that request. But you seem to be proposing that the server would return arbitrary files with the assumption that the client would know what to do with them.

不过,如果你要建议客户先明确要求多个文件,那么我会说,你可以将要发生什么。 HTTP 1.1规范确实允许接受客户请求头,表示multipart的支持,因此这似乎是HTTP设计师是如何设想这方面的工作。不幸的是,规范是沉默的客户端应该如何识别它希望接收的文件,如果你在一个真空看待HTTP,因为它的定义,而不是通过浏览器和网站的镜头,这是可以理解的。那是留给客户端和服务器来解决一个实现细节。它是适用于不同的层的关注。 - 内容是什么以及它是如何被消耗,而不是如何请求它和运输它

However, if you were to propose that the client first explicitly requests multiple files, then I would say you could be on to something. The HTTP 1.1 specification does allow the Accept client-request header to indicate multipart support, so this would appear to be how the HTTP designers envisioned this working. Unfortunately the spec is silent about how the client should identify the files it expects to receive, and this is understandable if you look at HTTP in a vacuum, as it is defined, rather than through the lens of browsers and websites. That is an implementation detail that is left up to the client and server to settle. It is a concern which applies to a different layer -- what the content is and how it is consumed, rather than how to request it and transport it.

这是很容易想象各种解决方案,当然,但没有一个标准的参考,它似乎没有保证上的浏览器开发的部件的工作。我能想象有人像微软(拥有超过一个广泛采用的服务器和浏览器控制)实现这一点,但他们会发明一种规范,人们会抱怨。显然,我们决定最好还是等待10年的W3C上达成一致的东西...

It is easy to imagine various solutions, of course, but without a standard to refer to, it wouldn't seem to warrant the effort on the part of the browser developers. I could imagine someone like Microsoft (with control over a widely-adopted server and browser) implementing this, but they'd be inventing a spec and people would complain. Apparently we've decided it's better to wait 10 years for the W3C to agree on something...

这篇关于有没有为什么多部分HTTP响应不普遍支持在浏览器中一个事实上或成立的原因吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆