• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Will a separate domain for images improve loading times?

LPH

Well-known member
#1
My host allows subdirectories to be loaded as subdomains. For example the subdirectory /images can also be loaded as images.domain.com ....

Would performance improve if the header of the site was loaded from images.domain.com versus /images ?

I ask after listening to a web performance presentation in which the presenter suggested loading content in parallel helps. Every ms helps.

What do you think? Would adding images from a separate domain improve performance?
 

Jeremy P

Well-known member
#2
Probably, browsers limit the number of active requests by each domain. So it won't load more than X number of things at a time on the same domain (connections are throttled). By using a separate domain you can double the number of allowed requests at a time, which can speed up loading.

Also, if your site is on a subdomain (like www) it will not send your forum's cookies when requesting the images, which can have a (probably tiny) positive impact on performance.
 
#3
It would need to be a completely different domain to download content "in parallel", browsers still consider subdomains part of the same domain.
 

LPH

Well-known member
#4
Please clarify for me.

It would need to be a completely different domain to download content "in parallel", browsers still consider subdomains part of the same domain.
What if there is mapping being done and the domains are really all the same files ... then does this hold true?

In other words, Can I use a domain that is just parked on that server (a .net which rolls over to .com)?

For example, tuxreports.net rolls to .com ... then can I use the images.tuxreports.net ?
 

LPH

Well-known member
#5
Also, if your site is on a subdomain (like www) it will not send your forum's cookies when requesting the images, which can have a (probably tiny) positive impact on performance.
Thank you. I'll have to figure out how that would work ...
 

Jeremy P

Well-known member
#6
It would need to be a completely different domain to download content "in parallel", browsers still consider subdomains part of the same domain.
I don't believe that's entirely correct.. do you have a source?
http://stackoverflow.com/questions/...load-two-components-in-parallel-per-subdomain

Though a completely different domain would be wise if your site is not accessible strictly via subdomain (for the cookie thing I mentioned).

Thank you. I'll have to figure out how that would work ...
Either redirect www.yoursite.com/anything to yoursite.com/anything or vice versa.
If you use www, you could use images.yoursite.com. If you don't, you'd have to use a completely different domain.