As a webmaster, we often run website speed test and learn that use of the cookie-free domains will improve website performance. A cookie-free domain saves network traffic by not sending cookie data with HTTP request.
What are cookies?
An HTTP Cookie is a small piece of data sent from the server with HTTP response, and stored in user's computer as part of web browser data. When users request a specific page, the user's cookie from the last response is sent with the request to the server. Cookies are used to manage a user's session, personalize the user's experience and used for tracking purposes. Cookies store user-specific stateful information and exchanged with server to provide login status, identify user's shopping cart and other stateful information about the user.
Why use cookie-free domains?
How do you setup a cookie-free domain?
Although you may wish to use a cookie-less domain for hosting static contents, in certain circumstances you may not be able to setup a cookie-less subdomain if you're using 3rd-party services like Adsense and Cloudflare. In those cases, you may require to purchase a new domain name or create a cookie-less domain.
- If you're using cookies in the root domain name (i.e iplocation.net), you won't be able to use subdomain as a cookie-less domain.
- If you're using Adsense to display banners on your website, setting a cookie-less "sub" domain will not work. Adsense set cookies on every domain under one verified domain name.
- If you're using CloudFlare as a gate keeper, you won't be able to use a cookie-free domain as CloudFlare sets __cfduid cookie to every response it returns.
Leave a comment
All comments are moderated. Spammy and bot submitted comments are deleted. Please submit the comments that are helpful to others, and we'll approve your comments. A comment that includes outbound link will only be approved if the content is relevant to the topic, and has some value to our readers.