# "XXX Items remaining" IE slow page loading problem



## NeutrinoMan

I have a problem with my php/MySQL website. When users visit the site using Internet Explorer, in the bottom left corner of the browser it runs through thousands of "Items remaining" in a "countdown" fashion. When the countdown of items remaining reaches zero, then the page finally loads. This really slows things down for the user.

This DOES NOT occur when viewing the site with FireFox, Safari, or any other browser. FireFox and Safari load the website pages all at once, so loading occurs almost instantly.

Has anyone else run into this issue? I'm really stumped. :4-dontkno


----------



## dm01

That's what IE does, there is nothing you can do about this.

The slowness is also probably just IE being IE.


----------



## NeutrinoMan

:sigh:

I was afraid of that. I've been researching this inside and out, and I can't find any code manipulation that would work around this problem in Internet Exploder. The morons behind IE seem to have it accessing the dbase in the most inefficient, sequential manner possible.:upset:

Thanks for your input anyway, always good to hear from a fellow Canuck! :wave:

If anyone else has a magic solution to this, please put me out of my misery. If anyone is curious to see this wonderful bit of annoyance in action, dust off your IE and point it here.


----------



## dm01

This is how IE handles PHP. I think it's part of their plot to take over the world with ASP.


----------



## daniel142005

dm01 said:


> This is how IE handles PHP. I think it's part of their plot to take over the world with ASP.


IE doesn't handle php, the server does. All IE would see is the HTML that PHP renders. 


Ok, I think this is a caching problem, I'm not sure exactly what all 1000 "items" are though... take a look at the last post on this thread:
http://www.webmasterworld.com/forum21/11679.htm

See if the server cache controls helps, it seems that even though the page loaded right away for me it was counting down all 1000+ items... You may want to try ajax and put a "Loading" bar on there if its bugging you.


----------



## NeutrinoMan

Just an update, I have tested this issue in IE8 and the problem exists there too, although the countdown of the items is much faster, so much so that the occurs in "leaps" of 100 or so. However, it still loads through 1000s of items resulting in an unacceptably long delay. :upset:

Seeing that the loading is faster in IE8 makes me think that the problem is specific to IE and not a server issue. If that's true, perhaps there's a faint hope of coding workaround. I've investigated and played with server cache control, and it doesn't help. :sigh:

Yes, I've reported this with the IE8 error reporting tool, like that will make any difference! :laugh:

Anyway, I'm still all ears on this issue if anyone has any ideas.


----------



## NeutrinoMan

STILL haven't solved this problem - bloody frustrating. IE sucks big time - it's almost as if they have purposely designed it to handle php poorly.


----------



## dm01

This issue surfaces with IE only. Opera (9.64 I) has no problems loading the page.

I've looked at the source and I don't have a clue what your problem is PHP-wise. I'm still looking .


----------



## daniel142005

> it's almost as if they have purposely designed it to handle php poorly.


If your still looking for it being caused by PHP then I'm 99% sure you won't find a solution. PHP is done on the server, not the web browser. For Example:

Server - test.php


PHP:


echo "<b>hello world</b>";

The test.php is then sent to the php interpreter, the php interpreter then renders the correct html, which in this case would be:



HTML:


<b>hell world</b>

After the server renders the html THEN it is sent over the internet to the viewer's web browser. Internet Explorer does not handle php, asp, jsp, or any other server-side language. Your problem probably lies in how the web page is designed with CSS/Javascript/HTML, I assume the "items" are images?

Edit: --
After some more searching I found another common cause. If you are including any javascript files that are not in <head> try moving them to the bottom of the page and see what happens.

Also, if you are using any javascript libraries such as scriptaculous try and see what happens without them, if that stops it then maybe we can narrow it down even more.


----------



## NeutrinoMan

I think daniel is right, this probably isn't a php problem after all. I sent my question to a php expert and she replied as follows:

I can't really be much help. One thing I know for sure is that the problem is not with PHP. PHP runs in the Web server (Apache?) and outputs the code that defines the Web page. By the time the code gets to the browser, there is no PHP involved. PHP has already done it's thing and the only thing that arrives at the browser is the output from the PHP script, which is HTML, JavaScript, etc. So, if it behaves differently in different browsers, the problem is in the HTML, JavaScript, etc., because that is the only code that the browser sees.

...which is basically what daniel is saying.

Thanks for the tip on the javascript, I'll give that a try and see what happens.

Man, this is one nut I would sure like to crack! :upset:


----------



## NeutrinoMan

Some testing results:

IE6: scripting enabled: time to load page: *90 seconds*
IE6: scripting disabled: time to load page: *19 seconds
*
IE8: scripting enabled: time to load page: *74 seconds*
IE8s: scripting enabled: time to load page: *15 seconds*

I repeated the test several times, always with the same results, right to the second.

This would imply that IE is being slowed down by the javascript. However, I performed another test that contradicts this.

I copied the source view from *the page* and then saved it as an HTML file.

Then I opened the local copy of the html file using IE, and... The page *loads instantly* (I even emptied the cache first, just to be sure it was loading it from scratch). I know the javascript was loaded as well, because all the scripting features work.

I took that same html file and put it on the server, and of course, it goes back to loading super slow. :upset::upset::upset:

My conclusion from that test is that IE can handle the code and javascript in the page just fine, but it's something about having to get the content from the server that IE can't handle.

Very confusing, very frustrating.


----------



## daniel142005

It could be the javascript, any way you could give us a link or attach the javascript file?


----------



## NeutrinoMan

Yes, of course - thanks in advance for looking at them.

Scripts attached.


----------



## daniel142005

Hmm, I don't really see anything that would cause it but just to be sure, try disabling javascript in the browser. You can find instructions here: http://kb.iu.edu/data/ahqx.html 

Once its disabled, restart the browser and go back to the page. If its still doing it then its not the javascript, if thats the case if you have any css files could you attach them?


Also, are you designing these web pages in any type of IDE that generates the code for you? or are you typing up the HTML by hand? If you are, what software are you using?


----------



## NeutrinoMan

Thanks Daniel,

Yeah I tried disabling javascript already, if you look a couple of posts back I have the results described with the load times. My concern there is that even though it loads faster without scripting enabled, it still runs through the "XXX items remaining" and still takes a considerable amount of time. So my gut says it's not the scripts that are the root of the problem.

The pages are done by hand from scratch in TACO.

I've attached the stylesheet, again, thanks for the input. :smile:


----------



## NeutrinoMan

SOLUTION!!! FINALLY! :grin:

http://stackoverflow.com/questions/734824/anyone-have-ideas-for-solving-the-n-items-remaining-problem-on-internet-explorer

Just in case that page ever goes down, here is the problem and solution:

---------------------------------------------------

Description
This bug is in IE6 to IE8.

If you use CSS, to enable IE "behavior" via the url() syntax to an external file, IE indicates in the status bar that it is downloading the file. - fine.

However, it gets ***CACHED*** by the browser (if the headers are set correctly) however IE insists on polluting the status bar with "456 items remaining" as it "claims" a download for each and every reference to the ***SINGLE*** HTC file.

to reproduce, add this style to a page.

<style>
body * **
behavior:url(anyfile.htc);
}
</style>

This will cause the status message for *EVERY* element on the page as the page loads. It is so anoying, that it causes the UI to flicker, and actually slows the page load significantly.

Note: this is regardless of the content in the HTC file, a simple onmouseover event handler to alert Hello World causes the issue.

---------------------------------------------------

Conclusion? IE SUCKS!!!


----------



## tee8

NeutrinoMan said:


> SOLUTION!!! FINALLY! :grin:
> 
> http://stackoverflow.com/questions/734824/anyone-have-ideas-for-solving-the-n-items-remaining-problem-on-internet-explorer
> 
> Just in case that page ever goes down, here is the problem and solution:
> 
> ---------------------------------------------------
> 
> Description
> This bug is in IE6 to IE8.
> 
> If you use CSS, to enable IE "behavior" via the url() syntax to an external file, IE indicates in the status bar that it is downloading the file. - fine.
> 
> However, it gets ***CACHED*** by the browser (if the headers are set correctly) however IE insists on polluting the status bar with "456 items remaining" as it "claims" a download for each and every reference to the ***SINGLE*** HTC file.
> 
> to reproduce, add this style to a page.
> 
> <style>
> body * **
> behavior:url(anyfile.htc);
> }
> </style>
> 
> This will cause the status message for *EVERY* element on the page as the page loads. It is so anoying, that it causes the UI to flicker, and actually slows the page load significantly.
> 
> Note: this is regardless of the content in the HTC file, a simple onmouseover event handler to alert Hello World causes the issue.
> 
> ---------------------------------------------------
> 
> Conclusion? IE SUCKS!!!


Just want to say THANK YOU for tracking down this issue. ray: Wow, what an annoying problem. Unfortunately it doesn't look like there's a fix, so I guess in my case IE 6 users won't see their transparent PNGs. Ah well if they're using IE 6 that's the least of their problems anyway.


----------

