简体   繁体   English

使用IE6令人难以忍受的缓慢AJAX

[英]Excruciatingly slow AJAX with IE6

The title, I'm sure, is going to provoke a "here we go again..." reaction with many readers. 我敢肯定,这个头衔会激起许多读者的“我们再来......”的反应。 Apologies. 道歉。 I have Googled this problem and got the phone book. 我用Google搜索了这个问题并得到了电话簿。 Mostly regarding SSL, it must be said. 主要是关于SSL,必须说。 Others point to the terrible JS engine in IE. 其他人指出IE中可怕的JS引擎。 None of the internet rants I found have really answered this satisfactorily for me. 我找到的互联网咆哮都没有给我带来满意的答复。 So I thought I would post here... 所以我想我会在这里发帖......

I am building a web app, mostly developed in Firefox (because of Firebug), tested in Opera, Chrome, Safari and... IE. 我正在构建一个Web应用程序,主要是在Firefox中开发的(因为Firebug),在Opera,Chrome,Safari和IE中进行了测试。 Lots of jQuery, lots of AJAX. 很多jQuery,很多AJAX。 Web server is Apache on Win XP. Web服务器是Win XP上的Apache。 Browser response is usually blazingly fast (the web server's on the LAN and does nothing else), except for IE, which is EXCRUCIATINGLY slow. 浏览器响应通常非常快(网络服务器在局域网上没有其他任何东西),IE除外,它的速度非常慢。

My code is generally structured along these lines: 我的代码通常按以下方式构建:

module1= function() {
    // JS code backing html in div1
};

$div1.load("div1.html",function() {
    module1();
});

That is, the JS code for module1 is known to the browser from the word "go", though I would expect that compilation of this code is deferred in all browsers until I actually call the module1() closure, which only follows on a successful load(). 也就是说,模块1的JS代码是浏览器从单词“go”中知道的,虽然我希望在所有浏览器中推迟编译此代码,直到我实际调用module1()闭包,这只是在成功之后加载()。 I can therefore readily believe that a slow JS engine, as may be present in IE, will present a drag (to displaying div1). 因此,我可以很容易地相信,IE中可能存在的慢速JS引擎会产生阻力(显示div1)。 However... 然而...

What I notice is that while IE6 goes about late-loading my HTML snippets and all attendant components (images, mostly), when I pull up another browser (to pass the time) and load my site, that browser will hang until such time as IE finishes downloading. 我注意到,虽然IE6会延迟加载我的HTML代码段和所有附带组件(主要是图像),当我启动另一个浏览器(以节省时间)并加载我的网站时,该浏览器将一直挂起,直到IE完成下载。 That is, IE completely clobbers my Apache server for everyone else. 也就是说,IE完全破坏了我的Apache服务器。

This makes me think that this is not, primarily, a slow-JS interpretation problem. 这让我觉得这主要不是一个缓慢的JS解释问题。 That in fact there might be some hand-shake problems between Apache and IE. 事实上,Apache和IE之间可能存在一些握手问题。 I have no evidence of this in Apache's logs, hence I thought I would ask. 我在Apache的日志中没有这方面的证据,因此我想我会问。

Does anyone have any ideas? 有没有人有任何想法? Is there a (known) configuration issue on Apache? Apache上是否存在(已知)配置问题?

PS: I might add that during these protracted late-loading efforts, IE's status bar - which is, I believe, an unreliable progress indicator - quite often shows URLs to my icons (ie very small .gif and .png files). PS:我可能会补充一点,在这些拖延的后期加载过程中,IE的状态栏 - 我相信,这是一个不可靠的进度指示器 - 经常显示我的图标的URL(即非常小的.gif和.png文件)。

Having working recently with IE6 I can maybe indicate one thing which helped us. 最近与IE6一起工作,我可以指出一件对我们有帮助的事情。 We reviewed quite all the jQuery code to add a lot (really a lot) of : 我们回顾了所有jQuery代码,以便添加很多(实际上很多):

SetTimeout(function() { <HERE TO REGULAR CODE WE HAD>,0});

This force repaint events on IE6 (some sort of new execution env with repaint if I understand well IE6 js) and, at least, The user can see parts of the page already loaded. 这个强制重绘IE6上的事件(某些新的执行环境,如果我理解IE6 js,重新绘制),并且至少,用户可以看到已加载的页面部分。 Very useful on load callbacks. 在加载回调时非常有用。 So at least user perception is better, blocks of the page appears and user perception of the speed is better. 因此,至少用户感知更好,页面的块出现并且用户对速度的感知更好。 But it seems that the whole real time was better as well. 但似乎整个实时也更好。

About IE6 apache interactions, as your apache server is not on your computer but on the LAN you should try to : 关于IE6 apache交互,因为你的apache服务器不在你的计算机上但在局域网上你应该尝试:

  • test the website from another machine, not the one where IE6 is running (running hard) 从另一台机器测试网站,而不是运行IE6的机器(运行困难)
  • activate mod_status and check the url /status to see if several workers are used by IE6 or only one 激活mod_status并检查url / status以查看IE6是否使用了多个worker或只使用了一个

IE6 is maybe having problems with the Keepliave requests, or with limitations on the number of parallel queries he can run on one server. IE6可能存在Keepliave请求的问题,或者他可以在一台服务器上运行的并行查询数量有限制。 But for that we'll need more information about the HTTP traffic when the problem occurs (and server-status at least is a good one, check Extended status as well). 但是为此我们在问题发生时需要有关HTTP流量的更多信息(并且服务器状态至少是一个好的,也检查扩展状态)。

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

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