Cookie-free Domains (why is the static picture, js,css stored in a separate domain?) )

Source: Internet
Author: User

There are a lot of children's shoes on this unrelated domain name cookie does not understand, this is actually in my front-end performance test video mentioned, address: http://edu.51cto.com/course/course_id-563.html Interested children's shoes can be seen.


Here I would like to explain the following, as follows (partial reference to the network content):


for static files (slices,JS script files and CSS files) enabling a new, separate domain name can reduce unnecessary cookie transfers, increase request speed, and reduce bandwidth.

We know that when a URL is requested from the HTTP server, the browser compares the URL to all cookies stored in the client's host, and if the domain name matches the cookie, the line containing the first name/value in the matching cookie is included in the HTTP request header. To ensure that the functionality that relies on cookies is implemented. However, when a static picture is requested, there is no point in transmitting the cookie.


In addition, cookie access is not allowed across domains, this is very understandable, because sometimes the cookie file will store some more sensitive or important information, if you allow cross-domain reading, then any site can get the target site's cookie, which is very dangerous. With this, we can put the static file under the new independent domain name, because the new domain name only put static files (mostly pictures and CSS, for JS files, if it involves read and write cookies, then be careful to handle), and does not produce a cookie, so the request for static files, is not carried Cookies, which improves the efficiency of transmission and reduces a certain amount of bandwidth.


Cockroach performance Test starts November 6, 2016, the price is half of the traditional training, the top 10 discount 300.

Jack Bauer python interface +appium Automated test class starts in February 2017

Official website: http://xqtesting.sxl.cn

Registration qq:2083503238, 1684129674, 480934277 ( all students enjoy a lifetime free unlimited number of re-learning benefits!) )

Cookie-free Domains (why would a static picture, js,css, be stored in a separate domain name?) )

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.