Domains HTTP Tips & Tutorials

2 reasons you should host all static content on a different domain

That is, to host all static content such as ready-made images, scripts, style sheets on a different domain rather than the primary one that hosts the page of the current URL. For example, if you intend to add static images to the web page located at, you should not place the images on, instead, put them somewhere else such as or

The first reasoning for this is that browsers load web assets one by one or sequentially from a single host. They will not start requesting and downloading the next asset until they are finished with the previous one from the same domain. Therefore, doubling the hosts or domains can accelerate the downloading speed by about 100% because browsers can simultaneously download stuff from 2 different domains.

Another reasoning is that if cookie or session is enabled on your website, the browser would send the session cookie every time it makes a request to the domain, which sort of is useless because it’s static content – the server doesn’t need the cookie at all to serve static content such as images. It’s not only a waste of bandwidth but also a waste of communication time. To avoid this, serve all static content from a domain that is not cookie enabled. For instance, if you have set cookie with, you can host all static content at, however, if you have enabled cookie by * instead of just, you will need to register a whole different domain to host the static content to steer clear of the useless overhead.

Not much for a small site, but this would be a major improvement regarding user experience for established, popular websites.

By Yang Yang

Hello, I'm Yang. I build online businesses that please people. Want to join in and post some useful articles on Shoot me a message.

6 replies on “2 reasons you should host all static content on a different domain”

Thank you very much for this very interesting detail about optimizing webserver performance.

Comments are closed.