久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='cn2c0'></small><noframes id='cn2c0'>

      <bdo id='cn2c0'></bdo><ul id='cn2c0'></ul>
    <tfoot id='cn2c0'></tfoot>

      1. <i id='cn2c0'><tr id='cn2c0'><dt id='cn2c0'><q id='cn2c0'><span id='cn2c0'><b id='cn2c0'><form id='cn2c0'><ins id='cn2c0'></ins><ul id='cn2c0'></ul><sub id='cn2c0'></sub></form><legend id='cn2c0'></legend><bdo id='cn2c0'><pre id='cn2c0'><center id='cn2c0'></center></pre></bdo></b><th id='cn2c0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='cn2c0'><tfoot id='cn2c0'></tfoot><dl id='cn2c0'><fieldset id='cn2c0'></fieldset></dl></div>

        <legend id='cn2c0'><style id='cn2c0'><dir id='cn2c0'><q id='cn2c0'></q></dir></style></legend>

        XMLHttpRequest 206 部分內(nèi)容

        XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)

            <tbody id='S0NtA'></tbody>
            <bdo id='S0NtA'></bdo><ul id='S0NtA'></ul>
            • <small id='S0NtA'></small><noframes id='S0NtA'>

              <i id='S0NtA'><tr id='S0NtA'><dt id='S0NtA'><q id='S0NtA'><span id='S0NtA'><b id='S0NtA'><form id='S0NtA'><ins id='S0NtA'></ins><ul id='S0NtA'></ul><sub id='S0NtA'></sub></form><legend id='S0NtA'></legend><bdo id='S0NtA'><pre id='S0NtA'><center id='S0NtA'></center></pre></bdo></b><th id='S0NtA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='S0NtA'><tfoot id='S0NtA'></tfoot><dl id='S0NtA'><fieldset id='S0NtA'></fieldset></dl></div>
              <tfoot id='S0NtA'></tfoot>
            • <legend id='S0NtA'><style id='S0NtA'><dir id='S0NtA'><q id='S0NtA'></q></dir></style></legend>
                • 本文介紹了XMLHttpRequest 206 部分內(nèi)容的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我想從 javascript 中的 XMLHttpRequest 對象發(fā)出部分內(nèi)容請求.我正在從服務(wù)器加載一個大的二進(jìn)制文件,我寧愿從服務(wù)器流式傳輸它,類似于處理 html5 視頻的方式.

                  I would like to issue a partial content request from an XMLHttpRequest object in javascript. I'm loading a large binary file from the server, and I'd rather stream it from the server similar to how html5 video is handled.

                  我可以使用 setRequestHeader 來設(shè)置 Range 標(biāo)頭.Chrome 中的網(wǎng)絡(luò)檢查器顯示 Range 標(biāo)頭設(shè)置成功.但是,Accept-Encoding 標(biāo)頭設(shè)置為gzip,deflate",Chrome 不允許我設(shè)置該標(biāo)頭(來自 W3C 標(biāo)準(zhǔn)).

                  I can use setRequestHeader to set the Range header. The Network inspector in Chrome shows that the Range header is set successfully. However, the Accept-Encoding header is set to "gzip,deflate", and Chrome will not let me set that header (from W3C standards).

                  有什么方法可以強(qiáng)制服務(wù)器只響應(yīng)來自 javascript 的 XMLHttpRequest 對象的 206 部分內(nèi)容?

                  Is there any way to force the server to respond with a 206 partial content from the XMLHttpRequest object only from javascript?

                  推薦答案

                  我想我知道為什么 206 請求不起作用了.啟用 gzip 壓縮后,如果可以對傳出數(shù)據(jù)進(jìn)行 gzip 壓縮,則范圍標(biāo)頭將被忽略.

                  I think I figured out why the 206 request wasn't working. With gzip compression enabled, the range header gets ignored if the outgoing data can be gzipped.

                  我請求的文件是一個大型二進(jìn)制文件,nginx 將其解釋為具有 mimetype application/octet-stream.這是被 gzip 壓縮的 mimetype 之一.如果我將文件重命名為 .png 文件類型,則圖像/png mimetype 不會被壓縮,因此范圍請求可以正常工作.

                  The file I was requesting was a large binary file, which nginx interpreted as having mimetype application/octet-stream. This is one of the mimetypes that gets gzipped. If I renamed the file to have a .png filetype, the image/png mimetype is not gzipped, and hence the range request works correctly.

                  這也是為什么將帶有 curl 的 Accept-Encoding 標(biāo)頭設(shè)置為 identity 也允許范圍請求正常工作的原因.但是,我無法從 XHR 更改該標(biāo)題.

                  This is also why setting the Accept-Encoding header with curl to identity also allows the range request to work fine. However, I cannot change that header from an XHR.

                  解決方案:更改服務(wù)器上的 mimetype 表!

                  Solution: Change the mimetype table on the server!

                  這篇關(guān)于XMLHttpRequest 206 部分內(nèi)容的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                    <bdo id='NjfnF'></bdo><ul id='NjfnF'></ul>
                    <i id='NjfnF'><tr id='NjfnF'><dt id='NjfnF'><q id='NjfnF'><span id='NjfnF'><b id='NjfnF'><form id='NjfnF'><ins id='NjfnF'></ins><ul id='NjfnF'></ul><sub id='NjfnF'></sub></form><legend id='NjfnF'></legend><bdo id='NjfnF'><pre id='NjfnF'><center id='NjfnF'></center></pre></bdo></b><th id='NjfnF'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NjfnF'><tfoot id='NjfnF'></tfoot><dl id='NjfnF'><fieldset id='NjfnF'></fieldset></dl></div>
                    <tfoot id='NjfnF'></tfoot>

                  • <small id='NjfnF'></small><noframes id='NjfnF'>

                    <legend id='NjfnF'><style id='NjfnF'><dir id='NjfnF'><q id='NjfnF'></q></dir></style></legend>

                              <tbody id='NjfnF'></tbody>

                          • 主站蜘蛛池模板: 天天欧美 | 天堂成人国产精品一区 | 欧美精品国产一区二区 | 理论片87福利理论电影 | 国产一区 | 日韩欧美在线观看视频网站 | 黑人精品欧美一区二区蜜桃 | 中日韩毛片 | 国产亚洲黄色片 | 在线观看av不卡 | 九九综合九九 | 久久丝袜| 久久精品一区 | 精品国产一级 | 国产成人综合一区二区三区 | av在线成人 | 久久久国产精品一区 | 成人久久网 | 在线视频一区二区三区 | 亚洲高清av在线 | 日韩视频一区在线观看 | 成人激情视频免费在线观看 | 国产综合av| 免费在线观看成年人视频 | xx性欧美肥妇精品久久久久久 | 宅男噜噜噜66一区二区 | 午夜影院视频 | 成人午夜 | 精品欧美一区二区三区免费观看 | 欧美一级片免费看 | 久久黄网 | 日韩av一区二区在线 | 亚洲美女一区 | 欧美精品一区二区在线观看 | 午夜欧美一区二区三区在线播放 | 国产1区2区3区 | 欧美日韩成人 | 亚洲一区二区在线电影 | 99reav | 国产99在线 | 欧美 | 91精品久久久久久久久久入口 |