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 http://www.example.com/page.html, you should not place the images on www.example.com, instead, put them somewhere else such as example-static.com or static.example.com.
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 example.com, you can host all static content at static.example.com, however, if you have enabled cookie by *.example.com instead of just example.com, 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.
You should also read:
- PHP: Session ID changes automatically at every request / page load
- scp, rsync: Safely and Quickly Transfer Files between Your Hosts / Hosting Accounts / Servers on SSH tunnel
- Free Reverse Domain & IP Tool for Other Websites or Domains on the Same Server
- Bulk Domain Name Availability Checker Tool to Batch Search Available Domains
- PHP cURL: Fetching URL and Sending Request with Cookies


Facebook
Twitter
Google Plus
{ 4 comments… read them below or add one }
Thank you very much for this very interesting detail about optimizing webserver performance.
Yes, this is indeed very useful.
And much more of it, the website http://www.topclassicalmusic.com/ from which I arrived to Kavoir is delightful. So thank you for keeping a standard up for true value.
Cheers,
Andrew
Thanks for the compliments, making simple and useful websites has been my hobby. :)
You explained this very clearly, in fact, I used it to persuade my boss to give a hosting budget – we self host atm.
{ 1 trackback }