weixin_33693070 2013-01-23 09:16 采纳率: 0%
浏览 28

Node.js块响应

I have unpleasant situation when one of my "long" response in some way blocks another AJAX requests. I call simultaneously 3 different resources:

var list = ['/api/filters','/api/criteria/brands','/api/criteria/genders']  
list.forEach(function(item){$.post(item)})

On server side I could see the following times in logfile:

GET /api/filters 304 51ms
GET /api/criteria/genders 200 1ms
GET /api/criteria/brands 200 0ms

Thats look cool for me, but in browser the picture is absolutely different.

picture with google chrome network tab

So it looks like browser wait for answer on first ( long request ) and only afterwards receive last 2 results.

What could be the reason for this behavior?

  • 写回答

2条回答 默认 最新

  • 斗士狗 2013-01-23 09:20
    关注

    Every browser just handles a specific amount of simultaneous requests at a time. If you fire 10 ajax requests at the same time, the browser put them on a stack and handles one after the other.

    You can find more information about the concurrent requests (because that includes images, javascript, etc as well) in browsern in this question.

    评论

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码