Reduce HTTP Requests

Source: Internet
Author: User
Tags base64

first, why to reduce the HTTP request
performance Golden Rule : Only 10%-20% of the end-user response time is spent on receiving the requested HTML document, and the rest of the 80%-90% is spent on requesting static resources;
How to improve : Reduce the number of static resources, thereby reducing the HTTP request;
The HTTP connection will incur some overhead : The DNS cache is queried during the parsing of the domain name;
HTTP1.1 protocol is serial send, that is, 100 requests will be sent one after the previous request completed before sending the following request;
ii. ways to reduce HTTP requests
map of the picture:
concept : Picture map allows a picture to be associated with multiple URLs, and the destination URL depends on the user's location on the image;
that is, multiple images are synthesized into a picture, and location information is adopted to locate the requested URL;
usage:<map><area></area></map>

CSS Wizard
concept : Display elements by specifying CSS background-img and background-position by using merged images;
Background-position:x:y,x and y can write positive values or write negative values. We can imagine that the upper left side of the picture is (0,0), with (0,0) coordinates to the right is the negative axis of x, and downward is the negative axis of y;
Usage:

Merge scripts and style sheets:
Use external JS and CSS files, do not write directly on the page
Merging JS and CSS files
Images use base64 encoding to reduce the number of page requests, Base64 encoding the image directly in the page, not to request the server;

Reduce HTTP Requests

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.