dongxiang3648 2010-07-29 08:16
浏览 37
已采纳

缓慢的服务器脚本使IE停滞

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?

  • 写回答

1条回答 默认 最新

  • duande1146 2010-07-29 18:21
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c