Browser queue wait time

There can be multiple reasons for a request to wait in the browser queue before it is sent to the server. The two most common reasons are:


    • If there are multiple JavaScript files on a web page, they are loaded one after the other by the browser and not loaded simultaneously. They are loaded in the same sequence as they are present on the web page. A web developer should always consider if it is possible to convert multiple JavaScript files on a page into a single JavaScript file.


      • Each browser has a limit on the number of concurrent requests that can be made to a single domain by a web page. For example, this limit is six for Firefox 3. If there are eight images on a web page that have to be loaded from the same domain, six requests will be made simultaneously, and the request for two images has to wait before a response for any of the previous two requests is received from the server.

 


When optimizing the performance of a web application from the browser's perspective, browser queue wait time is a very important consideration.


So how to bypass the maximum concurrent requests limit by the browser ?


If, for whatever reason, a web page needs to make a lot of requests to the server to get images, CSS files, AJAX responses, and so on, then one common technique is to host the image files on a separate subdomain. For example, host all the images for the Packt site on images.packtpub.com instead of the www.packtpub.com subdomain. However, it is important to keep in mind that every subdomain that is added also requires a DNS lookup. Based on a study by Yahoo, having two to four subdomains for a site is a good compromise between parallel requests and DNS lookups.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值