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

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

问题描述

我很好奇,为什么Facebook开发人员选择不将脚本和样式表组合成单个文件。相反,他们通过他们的CDN加载。



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



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

解决方案

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


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?

解决方案

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天全站免登陆