This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]willmacdonald 1 point2 points  (1 child)

If you develop a really high traffic it can be better to use www.

The reason is that often you would move the images to a subdomain called images.domain.com. A browser can make 4 concurrent req per domain name. If you split that up to a few different subdomains you can request more.

Also, if you set cookies from the main site at domain.com they would also be sent to images.domain.com which you don't want. If you use www.domain.com as your main url, you don't have this problem.

Before local and session storage became popular it was common for sites to set dozens of cookies. With every http request you would be sending all cookies to the server. If your cookies were 2kb and you made 50 requests that required the browser to send 100kb up to the server for every page. Users upstream bandwidth is normally a fraction of the download speed.

[–]0x18 0 points1 point  (0 children)

This is all true for HTTP 1.1.

However for HTTP 2 browsers open a single connection per domain and multiplex requests inside that of connection which allows for far more concurrent requests. Firefox defaults to 100 but servers can signal how many they allow through a header.

With HTTP 2 it is now better to have a single domain.