Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I went for an interview yesterday where I was asked this question:

"How does having assets (images/videos) stored on a secondary domain ( reduce the load time of"

To that I answered that by having the code "call" those assets from a secondary website it reduces the traffic that is coming to the main domain and therefore only applying bandwidth to the main domain vs having to also serve bandwidth to request assets.

Is that correct?

Also, If i am correct, would you say it makes sense to start new websites with this in mind or do you prefer having it done after large traffic rates are achieved?

share|improve this question
To most English speakers, "fasten" means "make stationary", not "increase the speed of". There are two meanings to "fast": the most common is "moving quickly, or capable of moving quickly", and the other is a nautical term meaning "fixed in place." "Fasten" is related to the second meaning. – kevin cline Jun 29 '12 at 17:13

I'm sorry, but your answer is incorrect. The main reason to use a sub domain would be to maximize parallel downloads, and you could take it a step further if said sub domain was cookie free. From Yahoo's Best Practices for Speeding Up Your Web Site:

Split Components Across Domains

Splitting components allows you to maximize parallel downloads. Make sure you're using not more than 2-4 domains because of the DNS lookup penalty. For example, you can host your HTML and dynamic content on and split static components between and


Use Cookie-free Domains for Components

When the browser makes a request for a static image and sends cookies together with the request, the server doesn't have any use for those cookies. So they only create network traffic for no good reason. You should make sure static components are requested with cookie-free requests. Create a subdomain and host all your static components there.

If your domain is, you can host your static components on However, if you've already set cookies on the top-level domain as opposed to, then all the requests to will include those cookies. In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free. Yahoo! uses, YouTube uses, Amazon uses and so on.

share|improve this answer
I don't think AAA's answer is necessarily incorrect though. What they have described is a beneficial side effect of splitting your content across multiple domains. You have described the primary reason that would lead someone to consider splitting content if bandwidth is no object. But I have also encountered situations where bandwidth concerns are an issue. If I have a popular blog with lots of video content and a hosting plan with little bandwidth, the first thing I would do to decrease costs would be to move all my videos to another service and have the content fetched from there. – David Cowden Jun 29 '12 at 20:02
Although I will agree that I think your answer is what the interviewer was looking for (; – David Cowden Jun 29 '12 at 20:03
@DavidCowden Well... If I'm interviewing, I'd pretty much prefer a straight "I don't know" than vague generalities. I wouldn't mind AAA's answer in casual conversation, but definitely not in an interview. – Yannis Jun 30 '12 at 0:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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