views:

162

answers:

5

I read somewhere that browsers can only send a few concurrent request to resources on a domain. So if we split the resources across subdomains or may be domains .. will it speed up things?

Did you experiment something like this? What were the results or issues if any?

+2  A: 

If you are using cookies, then I would use another domain and have it setup not to accept any cookies. You could do this with css and javascript aswell.

http://sstatic.net/

Daniel A. White
A: 

The reason for the limit is to stop the browser overloading one particualr server. So if the subdomains are on another server it would speed up loading. If ones server can handle the extra load or has some kind of load balancing then yes it would help.

Adding subdomains without overhead such as that of cookies for static content also gives a performance boost as it's less data that needs to be transfered each request.

ewanm89
+5  A: 

It definitely helps, but first start with css sprites. Also keep in mind that every additional domain will require DNS request and therefore slows-down!

Look at this great introduction on Yahoo: Performance Research, Part 4: Maximizing Parallel Downloads in the Carpool Lane

Viliam
+1  A: 

It's a well known optimisation technique, and it can help in some situations. As with all things about optimisation, don't do anything before you know where the bottleneck is. You need to measure your site and fix the things that slows it down. Use something like YSlow or Page Speed for starters. Both extensions come with excellent guides in how to use them and how to do this kind of optimisation tweaking - be sure to read those through.

troelskn
It's definitely better to start at the bottlenecks :D
Gastón
A: 

If you do this, consider using the IP Address instead of a DNS Hostname for inline images, JavaScript, and CSS files (http://1.2.3.4/file.png). This avoids the additional DNS lookup, which can take a second or two. If you can change that IP address within a configuration file and if you would have control or knowledge of when that IP address changes, there is no benefit to using a DNS name.

Note that this may not be advisable if:

  • You don't have control or knowledge of when that IP address would change.
  • You are serving via HTTPS (I'm not sure you can get a signed certificate from a CA for an IP address).
  • You need to use DNS-based load balancing.
John Brayton