Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Whenever I login to stackoverflow or some sites I see lots of requests for sites like Why is this done rather than serving directly from the actual site? How does it help to speed up a website?

share|improve this question
I am using the Firefox AddOn PrivacyBadger that shows my as a tracker. Why and how should I react here? May I block it? – buhtz Sep 29 at 11:33

3 Answers 3

up vote 10 down vote accepted

Shameless theft:

Use Cookie-free Domains for Components

When the browser makes a request for a static image and sends cookies together with the request, the server doesn't have any use for those cookies. So they only create network traffic for no good reason. You should make sure static components are requested with cookie-free requests. Create a subdomain and host all your static components there. If your domain is you can host your static components on However, if you've already set cookies on the top-level domain as opposed to then all the requests to will include those cookies. In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free. Yahoo! uses, YouTube uses, Amazon uses and so on.

Another benefit of hosting static components on a cookie-free domain is that some proxies might refuse to cache the components that are requested with cookies. On a related note, if you wonder if you should use or for your home page, consider the cookie impact. Omitting www leaves you no choice but to write cookies to *, so for performance reasons it's best to use the www subdomain and write the cookies to that subdomain.

share|improve this answer

When this was added to Stack Overflow in August 2009 Jeff, as you would expect, wrote all about it on the SO blog. If you keep reading there's some more discussion about it later as well.

Essentially, it's all about reducing cookie traffic.

share|improve this answer

Cookies are sent with every request to domains that have cookies stored. By setting up a domain with no cookies, the size of the requests is decreased and the speed of requests is increased, this is useful for static content.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.