Does it help to use subdomains for image and javascript hosting?

If the only purpose is to score better on that site analysis test, I wouldn't bother. Since you're switching in the near future to the newer protocols, it'll very much be a waste of time.

On the other hand, if you want to offload your static assets (images, javascript, etc) to a content distribution network such as CloudFlare, Amazon CloudFront, or MaxCDN, then I would recommend creating a new domain, or using a subdomain of your existing domain for that. You'll only need one domain (or subdomain) for it, since CloudFlare currently uses SPDY, and all the major CDN's will use HTTP2 in the near future. So instead of images.mydomain.com AND js.mydomain.com, you could just create static.mydomain.com. However the better alternative would be to create an entirely new domain just for the assets so it's cookieless.

Here's a good guide for using XF with a CDN. The key parts are under the heading "How To Add Your CDN in Xenforo Settings"

We use CloudFlare with a completely separate domain than our website, and they're able to cache on average > 87% of our static data requests (javascript, etc), so our server can use its resources for generating the php pages for the visitors.
So I setup a separate domain for my data files in order to load from a cookieless domain, but pingdom is still recommending I load from cookieless domain. Is there something I have to do with my separate domain to stop it from using cookies?
 
@Mr. Goodie2Shoes @thedude

Thanks for your help guys. I'm planning to talk to my server guys and go ahead with using CloudFare to CDN my subdomains. Is this ok...

images.mydomain.com
js.mydomain.com
styles.mydomain.com
data.mydomain.com

I'm just tying to get a few concurrent downloads per page to ensure a quicker load speed.
How did you split styles from JS? I thought the config setting was for both of them combined.
 
Styles get their stuff from the Image Path style property, JS inherits from the setting in config.php
Don't many styles use JS that is located in the style directory though? If I point my domain shard conf file at the JS directory, won't it miss the style JS?
 
Don't many styles use JS that is located in the style directory though? If I point my domain shard conf file at the JS directory, won't it miss the style JS?
Most of the ones I use pull from the /js directory (in a subdirectory tied to the author/style), which I think is pretty much standard format.
The /styles should be pretty much limited to graphic images.
 
You don't need a separate domain if you force the www subdomain to serve your site. If you don't serve your site from a subdomain, your cookies get set for the root domain, which will include cookies with all subdomains.
 
Top Bottom