I've working on a simple HTML-CSS-JQuery based website and choose 000webhost as a free hosting provider.
It gives me sufficient space and bandwidth and a shared Unix based Apache Server.
Now on to my question, i had googled for pros and cons of managing subdomains especially for static data and concluded that, subdomain is good idea and can shared the load of HTTP request and response.
But what in my case where i've only one server available which is also shared?
Is it optimal to have subdomains on same server or its good to have just one domain and folder divisions?
Answer
Having multiple hostnames in URLs used to be quite important. There were mainly 2 reasons, which follow. But today I'd say it is often not that important.
The reasons are / used to be:
Sharding (an overloaded term): Older browsers would only open 2 connections per hostname. Thus if all HTML, CSS, JS & IMG files were retrieved from
www.company.com
then the browser would download at most 2 files at any time. Using multiple hostnames in internal URLs, i.e.http://www.company.com
as well asshard1.company.com
andshard2.company.com
would speed up the downloads. This is no longer important, because all modern browsers use 8 or more parallel connections per hostname.Cookieless subdomains: Assuming that
www.company.com
sets a number of cookies for stuff like login state and analytics, then there is a small performance benefit to serving static files from a cookieless domain, for examplestatic-files.company.com
. This still holds true today, and is still helpful -- but it is a smaller optimization. Cookies are usually quite small, and the time taken to transmit them is low, but of course it all adds up.
The classical book that broke the news about this is "High Performance Websites" by Steve Souders. Some of the specific recommendations in the book are a bit old, but it's still
the best all-round introduction to frontend performance engineering there is.
No comments:
Post a Comment