今天去金山网络面试的时候,被问到性能优化,我说了几个,最后说到了CDN,我说要尽量把静态的内容放置到CDN,但是为什么呢?面试官说既然你说到CDN,你就说说它的原理。之前有看过,但是忘记差不多了。
按我个人理解来说它是遵循就近原则,给用户找到最近的服务器来提供用户的静态内容,比如CSS文件、图像等,来提高用户访问网站的响应速度。
A content delivery network (CDN) is a system of distributed servers (network) that deliver webpages and other Web content to a user based on the geographic locations of the user, the origin of the webpage and a content delivery server.This service is effective in speeding the delivery of content of websites with high traffic and websites that have global reach. The closer the CDN server is to the user geographically, the faster the content will be delivered to the user. CDNs also provide protection from large surges in traffic.
上面说了内容分发网络是基于用户的地理位置、网页的源地址还有就是一个内容分发服务器。距离CDN服务器越近的用户,就能越快地获取到静态内容
有比较才有感觉到区别!
原文地址:http://blog.csdn.net/monkindey/article/details/24739149