HTTP Cookies: Minimizing Request Overheads With Cookieless Domains

Print Article Print Article

HTTP Cookies: Minimizing Request Overheads With Cookieless Domains

By Web Hosting Help Guy

What is a cookie?

A cookie is simply a piece of text stored by a user’s browser, which online applications use for statistics and personalization purposes for returning users. There are numerous ways that different websites use this data, such as stored shopping cart information, preferences, demographic data, and so on.

How they work…

Every time users go to your website they send an HTTP request (request for a URL) to pull up a page on your domain. The user’s web browser uploads all of the cookies that have been set for your domain each time they request to view a page. So, depending on how many cookies are set, the response time can vary due to the size of the HTTP request, since most users have a slower upload speed than download speed. More cookies make the HTTP request larger in size, thus, it takes longer to upload the HTTP request to your web server to retrieve their requested page.


WHHG Request Headers Screencap

When would you want to set a cookieless domain?

This question coincides with the way cookies work, which makes it dependent on what you intend to utilize cookies for.

Unless you want cookies set for a specific subdomain or just for your homepage, you may actually have them set incorrectly. This would cause more overhead request than necessary, slowing down a web page’s response time.

If you do not want to have cookies set for subdomains, you will have to make sure your server or application only sets cookies to “www.example.com.” Otherwise, if you set cookies for just your top-level domain “example.com,” cookies will also be set for all subdomains set in the *.example.com format.

But, if you do want to have cookies set for a specific subdomain, such as “shop.example.com,” you will have to set cookies specifically for the “shop.example.com” URL.

You can do further reading about minimizing request overhead at: http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain

Can cookies be disabled cookies on browsers?

Yes they can. For example, on Internet Explorer 8, a user can go to:

Safety > Delete Browsing History > Then, select which stored files to delete (Temporary Internet Files, Cookies, History, Form Data, Passwords, and InPrivate Filtering Data)

Note:
First, close your browser, then re-open and delete the files because if you delete the files while you have a web page open, those cookies will not be deleted.


Aside from utilizing cookieless domains, what other methods do you use to reduce response latency?

Related posts:

  1. HTTP Status Codes: A Guide To The Most Common Responses
  2. Updating A CSS File – The Importance Of Clearing A Browser’s Cache
  3. Building A Website: Common Issues
  4. Web-Based Analytics Vs Web Server Logs
  5. An Introduction To Version Control Systems

Comments

Mars April 12th, 2011 at 12:16 am

i like how informative your articles are, maybe you could share some of them at http://www.orphicpixel.com as a guest post

Leave A Comment

Name *required

Email *not published *required

Website