Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting static images on subdomain

What are the benefits of hosting your images on a subdomain such as "img.domain.com"? If you're not on a CDN is there any real benefit to this?

Update

So doing this with CSS and JS files would also serve the same purpose?

like image 789
Webnet Avatar asked Nov 02 '09 04:11

Webnet


People also ask

Can we host website on subdomain?

These are just a few common examples, but you can use a subdomain for virtually any structure you want to introduce to your website. You could theoretically host every page on your website on a different subdomain, like contact.example.com for your contact page, about.example.com for your about page, etc.

Do subdomains need their own hosting?

Because subdomains are regarded as separate websites by Google, they also need to be hosted on separate hosting plans. This means that you will need to pay a separate hosting fee for each subdomain.


2 Answers

It can trick browsers to download with more 'pipes' of bandwidth. Say, the maximum of same downloads on a domain was three, hosting the images on another subdomain would effectively increase that to six.

The browser also doesn't have to send and receive cookies in the header, so it will go faster in that regard also.

like image 119
CodeJoust Avatar answered Oct 27 '22 04:10

CodeJoust


You can direct the subdomain to a different server, that is running a lighter weight web daemon such as nginx or lighthttpd. Then, you are not burdening the main, number crunching server with all the extra requests for static images.

like image 22
Cullen Walsh Avatar answered Oct 27 '22 05:10

Cullen Walsh