wordpress用cdn
You can learn how to secure a WordPress site with CloudFlare CDN in this SitePoint Premium course (requires a Premium subscription).
您可以在此SitePoint Premium课程中学习如何使用CloudFlare CDN保护WordPress网站 (需要Premium订阅)。
The Internet has a need for speed; that much everyone already knows. But why is this so important for your WordPress site, and why should you use a CDN for WordPress to help with your site’s loading times?
互联网需要速度。 每个人都已经知道的很多。 但是,为什么这对您的WordPress网站如此重要,为什么还要为WordPress使用CDN来帮助您的网站加载时间呢?
You’ve probably seen the 3 second loading time chart many times. It, and countless charts just like it, are everywhere.
您可能已经多次看到3秒的加载时间表 。 它,以及无数的图表,无处不在。
There’s a reason for that though – page loading time affects conversions. It’s as simple as that. And what are most WordPress sites aimed at, ultimately? I know that my sites are all focused on somehow making money. Whether they’re affiliate sites or service-based websites, they’re all aimed at converting.
不过,这是有原因的-页面加载时间会影响转化。 就这么简单。 最终,大多数WordPress网站的目标是什么? 我知道我的网站都集中在某种程度上赚钱 。 无论是会员网站还是基于服务的网站,它们都旨在转化。
If loading times affect conversions, then a fixation on speed is a good thing!
如果加载时间影响转换,那么固定速度是一件好事!
Take a look at four reasons that you may want to use a CDN for WordPress sites that you build or manage.
看一下您可能要对自己构建或管理的WordPress网站使用CDN的四个原因。
This is one of the strongest selling points of setting up a CDN for WordPress.
这是为WordPress设置CDN的最强卖点之一。
One of the biggest speed killers for your website is distance . Specifically, the distance between your hosting server and the visitor’s browser. Whilst the size of your page makes a real difference, the distance the content has to travel can definitely be the largest bottleneck in website loading speeds.
您网站的最大速度杀手之一是距离 。 具体而言,您的托管服务器与访问者的浏览器之间的距离。 尽管页面的大小确实有所不同,但是内容必须经过的距离绝对可以成为网站加载速度的最大瓶颈。
Ideally, your visitor needs to be as physically close to the hosting server as possible.
理想情况下,您的访客需要在物理上尽可能靠近托管服务器 。
Unfortunately, setting up a hosting server at a location which is physically close to any one particular visitor is all but impossible — unless you are setting up a CDN, that is.
不幸的是,几乎不可能在几乎任何一个特定访问者都近的地方设置托管服务器-除非您要设置CDN。
The very idea of a Content Delivery Network (CDN) is exactly that. A CDN’s primary purpose is to set up as many servers as possible in different geographical locations, such that anybody who hits the service is as physically close as possible to one of the locations.
内容交付网络(CDN)的想法就是这样。 CDN的主要目的是在不同的地理位置设置尽可能多的服务器,以便任何使用该服务的人在物理上都尽可能靠近其中一个位置。
Have a look at the following image from Incapsula CDN (one of my preferred services) which explains the concept perfectly.
请看下面来自Incapsula CDN (我的首选服务之一)的图像,它完美地解释了这个概念。
You can see that there are many CDN server points. In this manner, all visitors, in any location in the world, are always served content from a location which is (relatively speaking) near to them.
您可以看到有许多CDN服务器点。 以这种方式,总是向位于世界上任何位置的所有访问者提供(相对而言)他们附近的位置的内容。
Hosting static content on a CDN network is the closest you can get to creating a global hosting setup for your website.
在CDN网络上托管静态内容是为网站创建全局托管设置最接近的方法。
The next reason why a CDN is essential for your website is security.
CDN对您的网站必不可少的下一个原因是安全性。
Did you know that more than 51% of the web’s traffic actually comes from bots rather than humans?
您知道吗,网络上超过51%的流量实际上是来自机器人而不是人类?
When I first saw this report, I was completely taken aback:
当我第一次看到此报告时,我完全感到惊讶:
The even scarier statistic from the above is that 29% of web traffic comes from malicious bots.
从上述情况来看,更可怕的统计数据是29%的网络流量来自恶意机器人。
That means your website is constantly under a deluge of bad bot traffic. If you’ve ever taken a look at analytics data, or used a security plugin like WordFence, you’re already aware of this fact.
这意味着您的网站一直处在大量不良的机器人流量中。 如果您曾经看过分析数据,或者使用过诸如WordFence这样的安全性插件,那么您已经知道了这一事实。
These bots are constantly probing your site for vulnerabilities. If you slip slightly in your security efforts, if you have not chosen a good WordPress host, or if you miss a WordPress security update or a plugin update, rest assured your site will soon be suffering the consequences.
这些漫游器会不断地在您的网站上探测漏洞。 如果您在安全方面稍有懈怠,或者您没有选择好的WordPress主机 ,或者错过了WordPress安全更新或插件更新,请放心您的网站将很快遭受后果。
Most CDNs are able to identify and block bad bots rapidly, making your site safer when plugged into a CDN. The collective knowledge gained by the network can be used to prevent attacks on your own sites.
大多数CDN都能快速识别并阻止恶意程序,从而使您的站点在插入CDN时更加安全。 网络获得的集体知识可以用来防止对您自己的站点的攻击。
I’m sure you’ve been stuck in traffic at least a few times in your life. I know I have. Getting stuck in traffic is a waste of productive time and money.
我敢肯定,您一生中至少遇到过几次交通阻塞。 我知道我有 卡在交通中是浪费生产时间和金钱。
The same concept applies to your website.
相同的概念适用于您的网站。
However, it’s even worse when somebody purposely sends an overwhelming amount of traffic to your website.
但是,当有人故意向您的网站发送大量流量时,情况更糟。
In a Distributed Denial of Service (DDoS) attack, an army of compromised web servers or computers (or even IoT devices) are recruited to send so much traffic to your website, that your legitimate users unable to access it.
在分布式拒绝服务(DDoS)攻击中,大量受攻击的Web服务器或计算机(甚至IoT设备)被招募来向您的网站发送大量流量,以致合法用户无法访问它。
If your website is the lifeline of your business, a DDoS attack can literally bring your business to a standstill. Regardless of whether you’re on a shared hosting server or a dedicated server, your website won’t be able to keep up with the flood of traffic.
如果您的网站是企业的生命线,则DDoS攻击实际上会使您的企业陷入停顿。 无论您是使用共享托管服务器还是专用服务器,您的网站都将无法跟上大量流量。
The same concept used by a CDN to make your website fast, can also work in your favour by absorbing malicious traffic over a global network of servers fronting your website.
CDN用来使您的网站快速运行的相同概念,也可以通过在位于您网站前面的全球服务器网络上吸收恶意流量来为您服务。
Most CDN implementations use the concept of reverse proxy to serve your website. The reverse proxy will be the CDN server network.
大多数CDN实施都使用反向代理的概念来服务您的网站。 反向代理将是CDN服务器网络。
This means that your website’s visitors (both benign and malicious) will hit the CDN server closest to them before they hit your site’s actual server.
这意味着您网站的访问者(良性和恶意访问者)在访问您网站的实际服务器之前,将访问与其最接近的CDN服务器。
In this manner, any malicious traffic is intercepted before it actually gets to your server. CDNs have intelligent algorithms which are able to identify malicious DDoS traffic and kill it.
这样,所有恶意流量在实际到达您的服务器之前都会被拦截。 CDN具有智能算法,能够识别恶意DDoS流量并将其杀死。
Incapsula, MaxCDN, KeyCDN and most of the top players all have support for mitigating traffic-based attacks.
Incapsula,MaxCDN,KeyCDN和大多数顶级播放器都支持缓解基于流量的攻击。
When you’re creating a WordPress site which is meant to be fully optimized for performance, you’re going to have to perform a number of additional implementation steps.
创建要针对性能进行全面优化的WordPress网站时,您将不得不执行许多其他实施步骤。
You’ll be looking for an image optimization plugin, a content minification and combination plugin, a static and dynamic content caching plugin, and other tools to fully optimize the WordPress website. While it may be possible that one or two plugins are able to actually serve most of your optimization needs, you’ll still need to perform additional testing to ensure the plugins are able to operate correctly.
您将寻找一个图像优化插件,一个内容缩小和组合插件,一个静态和动态内容缓存插件以及其他工具来完全优化WordPress网站。 尽管可能有一个或两个插件能够真正满足您的大多数优化需求,但您仍然需要执行其他测试,以确保插件能够正确运行。
Personally, I’ve found that optimizing with various plugins is a nightmare of epic proportions.
就个人而言,我发现使用各种插件进行优化是史诗般的比例梦night。
CDNs are actually able to perform all of the above mentioned optimizations in one fell swoop. Image optimization, dynamic file compression, static and dynamic content caching are all built-in into the CDN.
CDN实际上能够一口气执行所有上述优化。 图像优化,动态文件压缩,静态和动态内容缓存都内置在CDN中。
Coupled with that, there are other optimizations such as Custom Content caching rules to fix any problems with specific plugins on your site.
除此之外,还有其他优化功能,例如“自定义内容”缓存规则,可解决您网站上特定插件的任何问题。
Most of these performance optimizations are going to be hard to achieve with your typical WordPress plugin.
使用典型的WordPress插件很难实现大多数这些性能优化。
Such stuff as session reuse optimization (particularly for HTTPS websites), TCP Connection pre-pooling and rapid purging all improve the optimization.
会话重用优化(尤其是HTTPS网站),TCP连接预池和快速清除等东西都可以改善优化。
Other improvements such as improving the SSL/TLS handshake process would not be something which the typical developer would be capable of optimizing by themselves. Having this completely handled by the CDN gives a significant boost, particularly to HTTPS websites, which unfortunately take a hit in performance when enabling HTTPS.
其他改进,例如改进SSL / TLS握手过程 ,通常的开发人员将无法自行进行优化。 CDN完全解决了这一问题,对HTTPS网站尤其是HTTPS网站产生了巨大的推动作用,不幸的是,启用HTTPS时,其性能受到了影响。
All of these above optimizations decrease the design and development time with the website whilst pushing the performance envelope as far as it can get.
以上所有这些优化措施都减少了网站的设计和开发时间,同时最大限度地提高了性能。
A CDN catering for all of the above will drastically reduce the time spent on optimization.
满足以上所有条件的CDN将大大减少优化所需的时间。
If you choose a reverse proxy enabled CDN, it is absolutely simple to setup, with just a couple of changes to your DNS settings. Those changes will immediately route traffic through the CDN and immediately deploy all of the benefits of that CDN.
如果您选择启用了反向代理的CDN,则只需进行几处DNS设置更改就可以非常简单地进行设置。 这些更改将立即将流量路由通过CDN,并立即部署该CDN的所有优势。
While you might have seen plenty of articles mentioning the need for installing a CDN plugin to be able to serve static content and images from a CDN, I’ve written elsewhere about how your typical CDN plugin works (i.e. by rewriting the source of your site to reference the CDN’s URL rather than that of your site). However, this is only necessary if you are using an upload CDN. If you’re looking for a WordPress CDN plugin, there’s plenty of choice in the WordPress plugin directory.
尽管您可能已经看到许多文章提到需要安装CDN插件才能提供CDN中的静态内容和图像,但我在其他地方写过有关您的典型CDN插件如何工作的信息(例如,重写了网站的来源)以引用CDN的URL而不是您的站点的URL)。 但是,仅在使用上载CDN时才需要这样做。 如果您正在寻找WordPress CDN插件,则WordPress插件目录中有很多选择 。
While installing a CDN plugin will make your website faster, your site won’t be benefiting from most of the advantages you learned about in this article. Instead, you should be implementing a CDN the way other non-WordPress websites do – using a reverse proxy CDN.
尽管安装CDN插件可以使您的网站更快,但是您将无法从本文中学到的大多数优点中受益。 相反,您应该像其他非WordPress网站一样实施CDN –使用反向代理CDN。
Speed is typically the most obvious benefit of using a CDN that people will mention over and over again.
速度通常是使用CDN的最明显的好处,人们会一再提及。
While the website loading speed is a critical component, and an essential justification for setting up a CDN, this should not be the only selling point.
尽管网站的加载速度是至关重要的,并且是设置CDN的必要依据,但这不应该是唯一的卖点。
The other points mentioned, particularly performance, security, protection and better optimization are just as important as website loading speed.
提到的其他要点,特别是性能,安全性,保护和更好的优化与网站加载速度同样重要。
Have you set up a CDN on your WordPress site(s), or used CDN plugins? Let us know about your experiences in the comments below!
您是否已在WordPress网站上设置了CDN或使用了CDN插件? 在下面的评论中让我们知道您的经历!
翻译自: https://www.sitepoint.com/4-reasons-cdn-for-wordpress/
wordpress用cdn
相关资源:wordpress_cdn_plugin-源码