CDN 和域
许多大型网站(Facebook 等)都为其内容设置 CDN。现在我注意到,这些 CDN 并不总是位于原始域上。
示例:Facebook 图片位于“photos-a.ak.fbcdn.net”上,
这是为什么?在“主”域(facebook.com)上没有大量子域是否会带来性能提升
A lot of big websites (facebook etc) are settings up CDN's for their content. Now I notice, that these CDN's are not always on the original domain.
Example: Facebook pictures are on "photos-a.ak.fbcdn.net"
Why is that? Is there a performance-gain in not having lots of subdomains on the "primary" domain (facebook.com)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于用户来说,性能有相当大的提升,因为使用不同的域,浏览器将不再需要发送 cookie。
有关 Cookieless 域的详细信息,请阅读本文:http:// code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain
There is quite a large performance gain for the user because with a different domain, the browser won't have to send the cookies anymore.
Read this article for more info about cookieless domains: http://code.google.com/speed/page-speed/docs/request.html#ServeFromCookielessDomain
Stackoverflow 本身在其静态内容网站上对此进行了很好的解释。
最初来自 雅虎。
Stackoverflow itself expains it very well on its static content site.
Originally from Yahoo.
CDN 通常分布在世界各地,因此与所有文件都位于主数据中心相比,用户更接近文件。
将单个域路由到不同的数据中心很困难(不可能?)。
此外,不再需要发送 cookie。对于 Facebook 来说,由于嵌入到整个网络中,它拥有大量的 cookie,这可以节省很大的开支。
A CDN is typically spread across the world so that the user is closer to files than if all files were in the main data center.
It is difficult (impossible?) to route a single domain to different data centers.
Also, cookies no longer need to be sent. For Facebook, which has a ton of cookies due to being embedded all over the web, this can be a big saver.