Archana Nagarkar I 9 Min Read I August 12, 2020

How to Use cookie-free domains

1. Quick read

When you check your site in the speed test tool generally you see the recommendation or warnings in GTmetrix tool ‘Use- Cookie free domain’ . Aren’t you aware about this term? You should have many more questions on this…like why should you use cookie-free domains? How to use cookie- free domain? etc…Don’t worry I will explain in detail in this blog so that you can be aware about this term and you get the importance of this in your shopify site speed optimization.

2. What are HTTP cookies?

HTTP cookies help to send the piece of data from a specific webpage or website.These small data are stored on the user’s system by the user’s web browser when he is browsing the web page. In other words, cookies are a small part of information sent from the web server to the user’s browser. They are later sent back to the server to notify it about the user’s previous activity like login authentication or items added to the shopping cart in the previous user session.
Cookies collect data to your website such as shopping cart items, pages you visited, etc. Using cookies to your website is valuable as they provide many benefits and better user experience on your site. It is helpful to determine whether or not a user is logged in and with which account. When users browse the website subsequently then the browser sends the cookie to the website’s server and provides the information that was set at last request. So cookies are useful for session management, tracking the users activity, etc.

What is a cookie-free domain?

Cookies are used for tracking, cart item, session (login), etc. When a user requests a web page URL (domain) then it sends back to the requested user data along with some response headers. And the responses headers might tell the browsers to set the cookie.
Cookie-free domain is a domain which does not send a command to the user’s browser to store cookies from the website. As our website contains some static content such as images, JS and CSS files those don’t change often. That’s why they don’t need to be set by cookies, as there is no user interaction with these resources.
By doing this cookie-free domain configuration you can decrease the size of the total request made by the user’s browser to our server. If it helps to reduce the server requests then definitely it will improve your site speed.

3. How cookie free domain work:

When the users requests static images from the web server and sends cookies with the requests, the server ignores the cookie and these cookies are unnecessary traffic and considered a performance hit since they have no benefit but can make HTTP requests and take longer to complete. A solution is to use a subdomain to host only the static content or your website. Doing this way subdomain will become cookie free since your cookies are set on the main website.
There are some advantages using Cookie-free domain:
  • Less network traffic
  • Decreased loading times on static content

For Further Details or Additional Information

OR

If you want to know more about our Services