[Original] JavaScript, css, and Image Blocking in Firefox (1)

Source: Internet
Author: User

External js files block images in the body

Take the following html as an example:

1 <! Doctype html> 2

After firebug network analysis:

Figure 1-1

Observe Figure 1-1 and draw the following two conclusions:

1. the browser processes requests (slices) concurrently. When the IP address and port number are the same,The default number of concurrent requests in Firefox is 6 (The number of concurrent requests for HTTP1.1 and HTTP1.0 varies depending on the browser version.)The six images are downloaded from the server at the same time.

2. After the js file is loaded, there is about idle time in the middle. During this time, the browser did not perform any operations. This phenomenon can be calledBlocking,The external js file blocks the img request in the body.

 

IfPlace external js files before </body>To eliminate blocking.

 

1 <! Doctype html> 2  

Figure 1-2

Compared to Figure 1-1 and figure 1-2, the same file is loaded, but the order is different, figure 1-2 saves about 0.1 s compared with Figure 1-1 (the test results are random)

 

 

 

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.