web-performanceweb-architecture

Why load images from different domain?


I have learned that browsers can only load a few files from the same domain at the same time. Therefore you should place your images on a different domain, or on a subdomain, to speed up page performance. Something like that...

Is it worth building websites like this, or will browsers change this function soon? Or maybe they already have?

Or maybe better asked: Will it soon become unnecessary to load your images from other domains for page performance?

The websites I am building now will not have their images hosted on a CDN.


Solution

  • The browser limits the concurrent HTTP connections to a single server for the server's sake. While the limits have been increased in most browsers over time, there will always be limitations in web development and if you're a serious web developer you should suck it up and adopt the current best practices for working within them.

    Without hosting your images on a CDN you can reduce the number of requests by combining your images into CSS sprites (archived) when appropriate. Check out the logo on StackOverflow, for example :)

    Also, combine your CSS and Javascript into single files for production deployments.