Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So my site is SPDY. All of my local assets are SPDY too. But the majority of my assets are served from Rackspace's CloudFiles CDN. This is not SPDY.

Do those files get streamed through SPDY somehow, or are they pulled in via separate laborious HTTP requests?

I currently have these CDN assets split across 3 different sub-domains. Should I merge them all into one (as is the preferred serving method for SPDY files, to cut down on DNS lookups), or should I leave them as they are because they're coming over regular HTTP 1.1?

Thanks, I couldn't find any decent information on this via googling.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

The best approach is to put everything on single domain using SPDY. If you can't do that, you need to calculate the appropriate number based on how many files you are serving.

DNS lookups will cost you about 20-120 milliseconds and are cached for varying periods. Most browsers in use at the moment allow 6 concurrent connections to a single domain (over HTTP) and 30 concurrent connections in total.

If you have more than 6 files they should be evenly split over (filecount/6) subdomains, up to a maximum of 5 subdomains.

share|improve this answer
    
Is a subdomain (assets.mydomain.com) suitable. Then I can specify cookies to sit on www.mydomain.com, so that they're not sent in any requests to assets.mydomain.com? Though I guess with SPDY and so long as my assets are mainly referenced in HTML/CSS (rather than independently requested) that might not be an issue? –  Codemonkey Oct 14 '13 at 14:46
1  
the reason for using cookie-less domains for images is largely mitigated by the header compression and pipelining in SPDY –  Colin Pickard Oct 14 '13 at 16:27

Don't forget about caching. If you have several subdomains which use the same images and your users may visit all of those subdomains it makes sense to keep the same asset domains for all subdomains. Because no matter which subdomain your user visits, it's already cached.

Great answer @Colin Pickard

share|improve this answer

Your Answer

 
discard

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.