What is a CDN and how to Implement a CDN in Joomla 什么是CDN以及如何在Joomla中实现CDN


Were you ever curious about why large websites load their pages quicker. Sure, they have high performance dedicated servers, but they also use a globally distributed network called Content Delivery Network (CDN). This article will introduce you to the concept of CDN, how it works and how it can be configured on a Joomla website or in other words how to perform a Joomla CDN integration to help improve website content delivery speeds and reduce latency.

你是否曾经好奇为什么大型网站加载页面更快。当然,他们有高性能的专用服务器,但他们也使用一个全球分布式网络称为内容交付网络(CDN)。本文将向您介绍CDN的概念,它是如何工作的,以及如何在Joomla网站上进行配置,或者换句话说,如何执行Joomla CDN集成,以帮助提高网站内容交付速度和减少延迟。

What is a Content Delivery Network (CDN)?


A Content Delivery Network (CDN) is a globally distributed network of web servers or Points of Presence (PoP) whose purpose is to provide faster content delivery by replicating the content and storing it on multiple CDN Servers. That way, the user can access the data from a server that is in the nearest geographical location. This has proved more efficient than storing content on just one central server. Clients accessing copies of their data on the multiple CDN servers will help avoid bottlenecks near that central server.


Without a CDN, central servers must respond to every single end user request. This results a subsequent load, thereby increasing the chances for central server failure if the traffic spikes are exceedingly high or if the load is persistent.


How does a Content Delivery Network (CDN) work?


Nowadays, web pages are quite complicated and complex; one feature being that the entire content is too big to be downloaded at once. The browser on the user's personal computer or smartphone makes multiple requests to the central web server where each of these requests takes a few milliseconds only to get a response.


Moreover, the further away the central server is located, more intermediate nodes or networking devices that multiply requests time will be inevitable. Subsequently, hundreds of requests are placed to the central server for a single webpage to load up completely. This not only increases the server load but also increases the latency.


Therefore, a website that applies Content Delivery Network (CDN) technology bridges the physical distance between the central server and the users’ personal computers. For example, a user is requesting a webpage from Saudi Arabia. The requested web page’s central server is located in the United States and there is a CDN server located in Switzerland.


If the webpage requested is a typical non-CDN website: The browser straight off connects to the server in the United States and asks for the HTML. The server sends it back from the United States to the browser in Saudi Arabia. Then the browser asks the United States web server again for images, Javascript and CSS. The server sends the images, Javascript and CSS to the browser in Saudi Arabia. But if the webpage requested is a CDN Website: The browser requests the HTML from the server in the United States. The browser receives the HTML from the United States and informs that the images, Javascript and CSS are in Switzerland CDN server. The images, Javascript and CSS are being sent by the Switzerland CDN server to the user browser in Saudi Arabia. 



What are the Content Delivery Network (CDN) Pros and Cons?


The Pros of using CDN are:


  • Web pages load quicker. 网页加载速度更快。
  • Better user experience. 更好的用户体验。
  • Reduce server bandwidth. 减少服务器带宽。
  • Lower server load. 降低服务器负载。
  • Increase in concurrent users on the central server. 中央服务器上并发用户的增加。
  • Geo-location of the content. 内容的地理位置。
  • Faster content delivery to the users’ browsers. 更快地将内容交付到用户的浏览器。

While the Cons of using CDN are:


  • Incorrect configuration of the CDN might cause viewing errors. CDN配置不正确可能会导致查看错误。
  • Cost additional expenses. 成本附加费用。
  • Adds complexity to your website and deployment procedures. 增加网站和部署程序的复杂性。
  • Network filters might block some Content Delivery Networks and prevent your website content from being loaded. 网络筛选器可能会阻止某些内容交付网络,并阻止加载您的网站内容。
  • Geo-location might actually be further away from your targeted audience. 地理位置可能实际上更远离您的目标受众。

What are the two types of Content Delivery Network (CDN)?


There are two different types of CDNs: push and original pull (or simply 'pull'). Each has its own advantages and disadvantages. Some sites work best with push CDNs, and some work better with pull CDNs.


Using a push CDN server, the site owner is required to upload website content (automatically or manually) directly to the CDN server and link that content to the website. The site owner, or the primary server, takes responsibility for providing the content to the CDN server, which in turn pushes it to the network. This is flexible as site owners can specify the content that is uploaded, when it expires and when it should be updated. This method is also the most efficient in terms of how the traffic is used. Content is uploaded only when it is new or changed, thus keeping traffic to a minimum.


On the contrary, an origin pull CDN works very differently. The site owner is not required to upload files onto the CDN, the CDN does it autonomously. The site owner leaves the content on the central server and rewrites the content URLs to point to the CDN server. When the visitors ask for a specific file, the CDN server will first go to the central server, pull the file and serve it. The CDN server will then cache that file until it expires. People who are trying to access a file for the first time, or accessing it after it has expired, may notice a small difference in speed. Setting the expiration correctly can help to minimise this problem, but it can involve trial and error.


How to Implement a Content Delivery Network (CDN) in Joomla?


We already mentioned the two main CDN types, which were Push and Pull CDNs. Both of them have their advantages depending on the setup of your website. The Pull CDN is the one which is great for most of the Joomla sites and there is not much initial setup and maintenance needed. 

我们已经提到了两种主要的CDN类型,即Push CDN和Pull CDN。他们都有自己的优势取决于您的网站的设置拉CDN是一个伟大的大多数Joomla网站,并没有太多的初始设置和维护需要.& nbsp;

We will now introduce to you some tips on how to implement the Pull CDN. You can start with choosing a CDN provider from the list shown in the below sections, and creating an account with them. Now establish the DNS redirects while reading the instructions given by the provider. Once the cdn.yourdomain.com points at your CDN account, it’s all good.

现在我们将向您介绍一些关于如何实施Pull CDN的技巧。您可以从以下部分所示的列表中选择CDN提供商,并创建一个帐户。现在,在阅读提供商提供的说明的同时建立DNS重定向。一旦cdn.yourdomain.com指向您的CDN帐户,一切都很好。

The next step after the DNS and the CDN account configuration is to change your website files URLs from www.mydomain.com to cdn.mydomain.com. Instead of changing all website files URLs manually as it's very inefficient and will take a lot of time to do that, you can save your time and do it automatically using a Joomla CDN extension from the list shown in the below section. Joomla CDN extension gives you advanced options, easy accessibility, less maintenance, and can automatically change the links of your websites images, Javascript and CSS. Some of these extensions also include the option to specify the file types which should be rewritten while allowing the use of multiple CDNs at once. You can also easily turn the CDN on and off by using such an extension.

DNS和CDN帐户配置后的下一步是将网站文件URL从www.example.com更改www.mydomain.com为cdn.mydomain.com。而不是手动更改所有网站文件的URL,因为它是非常低效的,并将花费大量的时间来做,你可以保存你的时间,并自动使用Joomla CDN扩展从下面的部分显示的列表。Joomla CDN扩展为您提供了高级选项,易于访问,维护更少,并可以自动更改您的网站图像,Javascript和CSS的链接。其中一些扩展还包括指定应重写的文件类型的选项,同时允许一次使用多个CDN。您还可以使用这样的扩展轻松地打开和关闭CDN。

Choosing a CDN Extension:


The Joomla CDN extensions can be found in the Joomla Extensions Directory, just go to Core Enhancements > Performance category or you may choose one from the below list according to your needs in order to set up the CDN integration:

Joomla CDN扩展可以在Joomla扩展目录中找到,只需转到核心增强>性能类别,或者您可以根据您的需要从下面的列表中选择一个,以便设置CDN集成:

Setting up these extensions is usually pretty easy to do, depending on which one you choose. You may find other extensions which might fit your needs. Make sure to check extension documentation for further information.


Choosing a CDN Provider:


You may choose one of the popular CDN providers listed below. Be noted that some of them are free with limited features while others should be purchased as subscriptions in order to benefit all CDN features.




CDNs serve a great purpose, they reduce significant traffic to the central server and improve the web experience which benefits both the content provider and the end users.


I hope you find this explanation of Content Delivery Networks helpful. A CDN requires extra configuration and extra expenses but the benefits are well worth it especially if you have users located all around the world.














电邮:该邮件地址已受到反垃圾邮件插件保护。要显示它需要在浏览器中启用 JavaScript。