CSS performance. Should .css files be served across resource domains?

I am reading a CSS Wizardry article on web optimization. http://csswizardry.com/2013/01/front-end-performance-for-web-designers-and-front-end-developers/

This is a great article. I invite everyone to read it.

The article suggests that CSS be in a critical way and should not be served across resource domains. This is because serving through an additional domain will result in a DNS lookup that takes time. Critical path = time between page request and actual observation.

Best practice dictates that you should characterize many assets by subdomains, but not CSS.

However, when I browse the source code of a large website such as Facebook or Apple, do they serve their CSS from a subdomain? Why are they doing this?

<link rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/Hwq5_AIg0hW.css" /> <link rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/v2/y-/r/UgmvVXsZ1MP.css" /> <link rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/v2/yY/r/uHqkbF3y3Er.css" /> <link rel="stylesheet" href="http://images.apple.com/global/styles/base.css" type="text/css" /> <link rel="stylesheet" href="http://images.apple.com/v/home/p/styles/home.css" type="text/css" /> <link rel="stylesheet" href="http://images.apple.com/v/home/p/styles/billboard.css" type="text/css" /> <link rel="stylesheet" href="http://images.apple.com/home/styles/home.css" type="text/css" /> 
+6
source share
2 answers

Perhaps they have other areas of optimization for their interface, and they have all kinds of dedicated servers. For a cap like me, Iโ€™ll take everything I can to the fore because Iโ€™m just setting the rendering time, and not a whole team of people.

I could not tell you why Apple and Facebook prefer to make decisions that they make, but everything I put into practice from the CSS Wizardry helped me, so I wonโ€™t argue.

It seems that Facebook serves from a separate domain, and Apple from a subdomain.

+1
source

Given that your computer / lan / ISP caches DNS queries and, in many cases, resources such as css files, as well as the fact that sites like Apple and facebook have a lot of re-traffic, it makes more sense to use separate domains / subdomains, as this means that the browser can load more resources in parallel when necessary. In addition, if these domains / subdomains are lifeless, there is another performance advantage. There is practically no penalty for viewing DNS for domains as common as those performed by facebook and apple.

Some useful info on yahoo and google

+1
source

All Articles