Web page Efficiency DNS lookup and parallel download _ website application
Source: Internet
Author: User
Yahoo's YSlow plugin one of the rules: rule 9–reduce DNS Lookups mentioned:
Reducing the number of unique hostnames has the potential to reduce the amount of parallel downloading The page. Avoiding DNS lookups cuts response times, but reducing the parallel downloads may increase the times. My guideline are to split this components across at least two but no more than four. This results in a good compromise between reducing DNS lookups and allowing a high degree of parallel.
Talk about your own understanding:
First, a page needs to access the number of domain name is n, then need n times DNS lookup, and DNS lookup is usually blocking call, that is, after the results can continue, so the more DNS lookup, the slower the response speed;
Second, parallel downloads (parallel downloading) are determined by two factors: the number of connections to the server and the number of pipelining requests within each connection.
The number of connections to the server in one page is determined by two factors:
The number of domain names that the page needs to access, and
Maximum number of connections allowed by the browser
The latter is also the maximum number of connections allowed by the browser (network.http.max-connections, default 24) in Mozilla/firefox, and the largest number of connections allowed per server ( Network.http.max-connections-per-server, defaults to 8) decision. If Max-connection-per-server is M, then a need to access n different domain name of the host page, can have a maximum of n*m connections-the premise is n*m less than max-connections value;
The number of Pipelining requests (pipelined requests) within each connection is also the browser's parameter (Firefox is set by Network.http.pipelining and defaults to 4), provided the server supports persistent Connection (for example, set keepalive on for Apache). The previous example does not require so many connections (for servers and browsers, multiple pipelining requests in a connection can be better than multiple parallel connections), assuming the pipelining value is p, you can use only n*m/p connections. (BTW, for Firefox to do some of the optimization of Plug-ins is actually the above settings to make adjustments)
So reducing the number of different hostname in the page does not necessarily reduce the number of concurrent downloads, but also the number of requests (CSS, JavaScript, images, etc.) that are required, so YSlow's explanation is potentially.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.