Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't Facebook combine its CSS/JS files?

I am curious as to why the Facebook developers have chosen to not combine their scripts and stylesheets into single files. Instead they are loaded on demand via their CDN.

Facebook is obviously a very complex application and I can understand how such modularity might make Facebook easier to maintain, but wouldn't the usual optimisation advice still apply (especially given its high level of usage)?

Or, does the fact that they are using a CDN avoid the usual performance impact of having lots of small scripts / styles?

like image 391
Lea Hayes Avatar asked Sep 28 '11 02:09

Lea Hayes


1 Answers

In a word BigPipe. They divide the page up into 'pagelets' each is processed separately on their servers and sent to the browser in parallel. Essentially almost everything (CSS, JS, images, content) is lazy loaded, thus it comes down in a bunch of small files.

like image 184
Useless Code Avatar answered Sep 23 '22 18:09

Useless Code