Firefox freezes completely during large file downloads; Ajax progress bar is invalid; IE6 works fine
I want to provide a progress bar for my users who are uploading very large files. I did some reading and implemented what should be a fairly simple solution:
- I have an element
<form>
containing a file input element; it istarget
set to the id of the hidden iframe. - On the server side, there is some Spring magic that attaches an object to a user's session; download progress can be requested from this object.
- After submitting the form, I start to repeat the Ajax call using
setInterval
which asks the server to fill the percentages using the above session object. The call is repeated every half second, skipping the Ajax call if the previous call has not yet completed. I am using the data from the call to update a displaywidth
element. When the backend reports that the download is complete, I clear the time interval.
I created a 100MB file and uploaded it using my interface. This is using Firefox 3.6.3. I found that although the download takes 20-25 seconds, the progress bar does not update to the very end. In addition, the entire browser is mostly frozen until the download completes.
I assumed my method must be wrong, but I tried the same page using IE6 and was completely amazed when it behaved the way I designed it - the progress bar was refreshed every half second and the whole load took about 15 seconds much faster than Firefox.
I don't have many add-ons, but I tried to disable Firebug and restart my browser. This improved performance a bit - I got maybe one additional mid-load mid-load update, but still far from acceptable.
Can anyone tell me what I can do to improve Firefox performance to IE6 level? Ugh, I can't believe I actually typed this.
EDIT:
I just tried to download a large file from Firefox 3.6.3 browser on a different machine than the one my webserver is running and it worked fine. Yes.
a source to share