简体   繁体   中英

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. Mostly regarding SSL, it must be said. Others point to the terrible JS engine in IE. 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. Lots of jQuery, lots of AJAX. Web server is Apache on Win XP. Browser response is usually blazingly fast (the web server's on the LAN and does nothing else), except for IE, which is EXCRUCIATINGLY slow.

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(). I can therefore readily believe that a slow JS engine, as may be present in IE, will present a drag (to displaying 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. That is, IE completely clobbers my Apache server for everyone else.

This makes me think that this is not, primarily, a slow-JS interpretation problem. That in fact there might be some hand-shake problems between Apache and IE. I have no evidence of this in Apache's logs, hence I thought I would ask.

Does anyone have any ideas? Is there a (known) configuration issue on 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).

Having working recently with IE6 I can maybe indicate one thing which helped us. We reviewed quite all the jQuery code to add a lot (really a lot) of :

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. 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 :

  • test the website from another machine, not the one where IE6 is running (running hard)
  • activate mod_status and check the url /status to see if several workers are used by IE6 or only one

IE6 is maybe having problems with the Keepliave requests, or with limitations on the number of parallel queries he can run on one server. 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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