I read in an article that in order to maximize parallel download from a webserver, we can group our image files in separate domains. Now if I have a website with domain name http://www.example.com/ as my root directory and all my images are all stored inside http://www.example.com/pictures directory, what should i do differently in terms of storing my image files to have separate domains for my them? do i just make a bunch of new folder 1,2,3,.. instead and split my image files across those folder or what? thanks.
Share
You don’t need to do anything with how you store your files. You just need to edit your DNS configuration to add subdomains (like
img1.example.com,img2.example.com) which all point back to your main server. Then you can just reference your images like:In essence, everything still resolves back to
http://www.example.com/pictures/..., but the browser is fooled into thinking that there are multiple independent subdomains serving up the images, thus giving you more threads to work with.