duanmeng3573 2014-06-05 10:24
浏览 40

1MB文件的加载类似于9.0KB文件,我的服务器在Chrome上

I try to make a speedtest with a 1 mo file on my webserver. The file is call with ajax request but when I call the 1mo file on Google Chrome the size downloaded is 9.0KB. I think is because on the header "Accept-Encoding" is set to "gzip,deflate,sdch"

How I can set the Accept-Encoding to none to download a real 1mo file ?

the file is name 1mo.file

javascript

  $(function () {
        console.log('DOM READY');
        $('#result').append('DOM READY<br>');
        var rand = Math.round(Math.random() * 1000);

        $.ajax({
          url: "1mo.file?"+rand,
        }).then(function () {
            console.log('then');
            $('#result').append('AJAX CALL<br>');
        }).done(function() {
         console.log( "done" );
        $('#result').append( "AJAX DONE<br>" );
        });
        console.log('SCRIPT FINISH');
        $('#result').append('SCRIPT FINISH<br>');
    });

html

<b>speed test :</b><br>
<div id="result"></div>

.htaccess

# for files that end with ".file"
<FilesMatch \.file$>
    SetEnv no-gzip 1
</FilesMatch>

You can see the script run on http://intuitisoft.com/apps/speedtest/

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器