简体   繁体   English

服务器回复巨大响应时,IE 9挂起

[英]IE 9 hangs when server replies with a huge response

I am testing download functionality for which I have written a php script. 我正在测试我编写了php脚本的下载功能。 This script reads a large file (10MB) using fopen and fread. 该脚本使用fopen和fread读取大文件(10MB)。 Using fread I am reading a chunk of 10MB in a buffer and that buffer I am echoing and then flushing out using flush and ob_flush functions. 使用fread,我正在缓冲区中读取10MB的块,并且正在回显该缓冲区,然后使用flush和ob_flush函数将其冲洗掉。 So that client receives this buffer and I am able to check number of bytes received. 这样客户端可以接收此缓冲区,并且我可以检查接收到的字节数。 This works fine in Chrome, FireFox and IE 8 but when I tested it in IE 9, the browser hangs and I am not able to get the proper downloaded bytes. 这在Chrome,FireFox和IE 8中都可以正常工作,但是当我在IE 9中对其进行测试时,浏览器挂起,并且我无法获得正确的下载字节。 Can someone suggest what are the other options that we can use to test this? 有人可以建议我们可以用来测试这一点的其他选项吗?

  define('CHUNK_SIZE', 1024*10240);
  $handle=fopen("10MBFile", 'rb');
  $buffer=fread($handle, CHUNK_SIZE);
  echo $buffer;
  ob_flush();
  flush();

Regds Regds

I had numerous strange hangups with IE9+ and apache and could fix it with adding this stuff into httpd.conf : 我使用IE9 +和apache进行了许多奇怪的挂断,可以通过将这些内容添加到httpd.conf来解决此问题:

# Deal with user agents that deliberately violate open standards
#
<IfModule setenvif_module>
BrowserMatch "MSIE 10.0;" bad_DNT
</IfModule>
<IfModule headers_module>
RequestHeader unset DNT env=bad_DNT
</IfModule>
AcceptFilter https none 
AcceptFilter http none 
EnableSendfile Off 
EnableMMAP off

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM