Web front-end optimization cookies for best practices

Source: Internet
Author: User

Web Front-End optimization Best practices The third part is for cookies. There are currently only 2 rules of practice.

1. Reduce cookies (reduce cookie Size)

Cookies are a very interesting topic. According to the RFC 2109 description, each client holds up to 300 cookies, up to 20 cookies per domain name (in fact, most browsers are now more than this, such as Firefox is 50), each cookie up to 4 K, note here 4K According to the different browsers may not be strict 4096. Don't pull it away, the most important thing for cookies is to try to control the size of the cookie and not cram in some useless information.

2. Cookies using domain name independence for WEB components (use Cookie-free Domains for components)

This topic was mentioned earlier in the discussion of Web image servers. Here the Web component (Component), more refers to static files, such as Picture CSS, Yahoo! Static files are on the yimg.com, the client requests static files, reduce the repeated transmission of the Cookie to the main domain name (yahoo.com) impact.

From this when the cookie crumbles can be seen, MySpace and eBay cookies are not small, presumably to the user behavior more concerned about. The personalization Platform was constructed shortly before EBay, which jumped out of the Cookie limit.

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.