Slow server script makes IE stall

I am working on a php web application which involves calls to 3rd party web services. Recently I've run into problems because some of the web services are slow and/or time out. (When this happens the service throws an error after 5-6 minutes, which is handled by the web application)

However, the problem arise that while waiting for the result/timeout, all other connections to the web application in the browser (other windows/tabs in IE) stall. It seem to be a problem with the browser, because if opening a secondary window in another browser (e.g. Chrome) the web application serves pages with no delay.

I've considered setting up the web service call asynchronously (a separate server.side process, or an ajax call in the browser), but in the mean time I'd like to know why IE is putting all connections to the web app on hold while waiting for one page? Could it be that a custom header or other trivial markup trick would tell IE to go on with connections to other pages at the same host?

Answers


the problem arise that while waiting for the result/timeout, all other connections to the web application in the browser

What you're seeing is normal and expected behavior, if you're using sessions. The default file-based session handler places a lock on the session file when the session owner makes a request. Once the request finishes, the lock is released. In the meantime, if the user makes any further requests, those requests will wait for the lock to be released before they can continue. This behavior prevents a race condition that could otherwise result in session data being lost.

If you aren't using sessions, or you've written your own session handler and it doesn't do locking (most do not, you have to code that behavior yourself), then yeah, IE's being freaky and I have no further suggestions.

I've considered setting up the web service call asynchronously

If the web service is unreliable, this is a good idea. You should consider Gearman, a work/message queue system. It has comprehensive PHP support as a PECL extension.


Need Your Help

Pyperclip does not persist if script exits

python clipboard pyperclip

I want to store something into the clipboard via a python script.

Multiple count() with WHERE clause

android sqlite

I have an SQL table which contains flashcard objects. The table has a column indicated whether a flashcard is free or paid. Flashcards are divided into categories. In my android app I need to displ...