久久久久久久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).

                  有什么方法可以強制服務(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>

                          • 主站蜘蛛池模板: 337p日本欧洲亚洲大胆鲁鲁 | 国产精品一区免费 | 亚洲一区影院 | 欧美成年网站 | 日韩欧美一区二区三区免费观看 | 精品婷婷| 91色站 | 午夜日韩视频 | 在线观看你懂的网站 | 欧美一卡二卡在线观看 | 久久com| 男女污污网站 | 亚洲国产精品久久久久婷婷老年 | 精品久久久久久久久久久久久久久久久 | 欧美色人 | 欧美日韩中 | 国产精品777一区二区 | 在线欧美一区二区 | 亚洲男女视频在线观看 | 99久久免费精品国产男女高不卡 | 在线视频99 | 在线欧美小视频 | 国产精品日韩欧美一区二区三区 | 视频在线一区二区 | 欧美中文在线 | 日韩免费激情视频 | 你懂的国产| 国产婷婷色一区二区三区 | 91国内产香蕉 | h视频在线播放 | 成年人在线观看视频 | 波波电影院一区二区三区 | 亚洲视频一区在线观看 | 日韩在线视频免费观看 | 国产婷婷精品 | 亚洲午夜精品 | 色必久久 | 97人人干| 亚洲国产69| 欧美在线一二三 | 麻豆视频在线免费看 |