为什么Facebook不结合其CSS / JS文件? [英] Why doesn't Facebook combine its CSS/JS files?

查看:147
本文介绍了为什么Facebook不结合其CSS / JS文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇为什么Facebook开发人员选择不将他们的脚本和样式表合并成单个文件。

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显然是一个非常复杂的应用程序,我可以理解这样的模块化如何使Facebook更容易维护,但不会通常的优化建议仍然适用(特别是考虑到其高水平的使用)?

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)?

或者,他们使用CDN的事实避免了通常的性能影响的小脚本/样式?

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

推荐答案

一句话 BigPipe 他们将页面分成'pagelets',每个在其服务器上单独处理并且并行发送到浏览器。基本上几乎所有的东西(CSS,JS,图像,内容)是懒惰加载,因此它在一堆小文件。

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.

这篇关于为什么Facebook不结合其CSS / JS文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆