Browsers only allow you to download a limited number of concurrent files from the same domain.

Would a subdomain for images (basically as a content delivery network) on the same web hosting server increase the number of files that can be downloaded simultaneously?

(And thus improve page loading time?)

Consider this example:


The img subdomain is hosted on the same web server (same IP & location) as the www domain.

2 Answers 2


Yes or no. Your assumption is correct and that more resources can be loaded in parallel by the browser if they are served from multiple domains. There are two cases to consider though:

  1. Your server is not presently serving at maximum capacity: In this case more requests being served simultaneously is better. Visitors who's download bandwidth is not already maxed out will see reduced page-load time.

  2. Your server is serving at maximum capacity: There will be little change, it may even slow down due to the overhead of getting and handling more requests. The way to speed up in this case is either to upgrade the server or use an actual CDN network.

You should look at your server performance logs to see which is the case. CPU usage is a good indicator when images are expected to be cached for the general case (you serve mostly the same images over-and-over). Disk usage is a better indicator when your image set is so large that it wont be cached so often (you serve different images to different users as for most personal gallery sites).

  • Great, thanks! What about on a shared server, is this log information easily available/compile-able?
    – Baumr
    Commented Mar 20, 2013 at 20:34
  • 1
    If they allow ssh do a 'top' or some shared hosting has this information in the control panel. Still believe that if you want good speed then ditch the shared hosting, go for VPS + CDN. Trying to pimp up shared hosting is like trying to pimp a wheelbarrow rather than pimping a BMW. Commented Mar 20, 2013 at 21:28
  • 1
    @Baumr - That depends how they do it. If you are allocated a slice of CPU, you will see a graph of your usage. In a load-balanced system, you have a cap and your process is throttled-down when it exceeds a certain limit. They gather statistics about how much this occurs per certain period of time.
    – Itai
    Commented Mar 21, 2013 at 0:26

Short answer yes using a sub domain will enable parallel downloading that can will improve the amount of fetches sent and received at any one time, also you can setup the sub domain to be cookieless with good expires which will further emulate the use of a CDN.

But bear in mind the following:

  • CDN mirrors your files all over the globe and speeds up the site for people all over the globe.
  • CDNs are extremely cheap.
  • Good CDNs do not slow down and scale with demand.
  • CDNs do not eat up your server resources up while server providing all the client requests can.
  • Using a CDN adds an additional layer of security if the main site gets hacked, Assuming you don't bare your API key.
  • CDN provide also API based features that allows you do to lots of funky stuff.
  • Data loss doesn't really happen on CDNs since 1, your files are mirrored all over the globe and 2 they use fail proof raid setups while your own server may not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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