How to - Parallelize downloads across hostnamesFollow @ggarron
Parallelize downloads across hostnames, this is usually one of the suggestions that Google's Page speed performance analysis tool in firebug gives you, and is sometimes a very easy task to perform, no matter if you are running Apache or Linghthttpd or Nginx.
Usually are pictures, so let's say you have your pictures (Or actually any kind of files) in:
Now let's create another directory structure like this.
sudo mkdir /var/www/cdn0.your-site -p
sudo mkdir /var/www/cdn1.your-site -p
sudo mkdir /var/www/cdn2.your-site -p
sudo mkdir /var/www/cdn3.your-site -p
Once this is done, create four new virtual servers, that is not going to be covered here, as it varies depending your distro and the web server you are using.
Declare the root of each of them to point the newly created directores, therefore for:
cdn0 the root directory should be
for cdn1 the root directory should be
/var/www/cdn1.your-site and so on.
Now run this command for each of those 4 domains.
sudo ln -s /var/www/your-site/images .
Do this with the four domains, all pointing to the same source, and then edit your DNS zone and create four A records.
cdn0 -> [Same ip of www.your-site.com] cdn1 -> [Same ip of www.your-site.com] cdn2 -> [Same ip of www.your-site.com] cdn3 -> [Same ip of www.your-site.com]
Now you are ready to restart your web server, and once that is done, you can start editing your webpages to point some images or some css or js files to cdn0 some others to cdn1 and so on, be sure to assign at least 4 files to each domain, otherwise the time you are gaingin in parallelism you are loosing in multiple DNS queries.