我们如何使WordPress比静态站点生成器更快(案例研究–加快WPBeginner的速度)

On the 10th anniversary of WPBeginner, I shared that WPBeginner hosting infrastructure got a huge upgrade thanks to our web hosting partner, HostGator.

在WPBeginner 成立10周年之际,我分享了WPBeginner托管基础架构得到了巨大的升级,这要归功于我们的Web托管合作伙伴HostGator

Shortly after, I started getting emails from readers asking me to share the details on how we made WPBeginner load blazing fast.

不久之后,我开始收到读者的电子邮件,要求我分享有关如何使WPBeginner负载Swift增加的详细信息。

Yes, WPBeginner load faster than most static site generators and in some cases faster than Google AMP sites too.

是的,WPBeginner的加载速度比大多数静态网站生成器快,在某些情况下,其加载速度也比Google AMP网站快。

In this article, I will give you behind the scenes look at how we made WordPress faster than static site generators and headless CMS platforms.

在本文中,我将在幕后介绍如何使WordPress比静态站点生成器和无头CMS平台更快。

Speeding up WPBeginner - Behind the Scenes

Note: This article is a bit more technical than what we typically publish on WPBeginner. For non-techy users, I recommend following our ultimate guide on how to speed up WordPress.

注意:本文比我们通常在WPBeginner上发布的内容更具技术性。 对于非技术用户,我建议遵循有关如何加快WordPress速度的最终指南

Update: We’re no longer using the setup shared in this article. Instead we have switched entirely to Google Cloud platform managed by SiteGround. We have the same speed results and have unlocked even faster back-end performance. Read why we switched to SiteGround.

更新:我们不再使用本文共享的设置。 相反,我们已完全切换到SiteGround管理的Google Cloud平台。 我们拥有相同的速度结果,并获得了更快的后端性能。 阅读为什么我们切换到SiteGround的原因

背景 (Background)

Lately WordPress has been getting a lot of bad rep from “modern” developers where they say WordPress is slow.

最近,WordPress从“现代”开发人员那里得到了很多不好的代表,他们说WordPress很慢。

The statement is usually followed up with, you should switch to a JAMstack static site generator like GatsbyJS. Others in the enterprise world will say that you should switch to a headless CMS like Contentful.

该语句通常跟进,你应该切换到JAMstack静态站点生成像GatsbyJS 。 企业界的其他人会说,您应该切换到Contentful这样的无头CMS。

Several of my very successful entrepreneur friends started asking me whether this was true.

我几个非常成功的企业家朋友开始问我这是否是真的。

Some even started the process of migrating to a headless CMS because they read case studies of how others unlocked huge speed improvements by switching from WordPress to static site generators.

有些人甚至开始了迁移到无头CMS的过程,因为他们阅读了一些案例研究,这些案例研究了其他人如何通过从WordPress切换到静态网站生成器来释放巨大的速度改进。

This was very frustrating for me because I knew they were wasting tens of thousands of dollars in migration costs. Not to mention, the endless customization costs that will rack up in the future.

这让我感到非常沮丧,因为我知道他们在浪费数万美元的迁移成本。 更不用说,无限的定制成本将在未来累积。

So I took it as a challenge to prove that a large WordPress content site like WPBeginner can load just as fast if not faster than most modern static site generators.

因此,我将其作为挑战来证明像WPBeginner这样的大型WordPress内容网站可以加载的速度与大多数现代静态网站生成器一样快,甚至还不及它。

You can call me old school, but at the end of the day, a static site is just a page loading from cache.

您可以称我为老学校,但是到最后,静态站点只是从缓存加载的页面。

结果 (Results)

Before I jump to the exact WordPress hosting infrastructure, server configurations, and plugins, I think its helpful to share the results.

在我跳到确切的WordPress托管基础结构,服务器配置和插件之前,我认为分享结果很有帮助。

Here’s how fast WPBeginner home page loads on Pingdom from their Washington, DC server:

以下是WPBeginner主页从其华盛顿特区服务器在Pingdom上加载的速度:

WPBeginner Homepage Pingdom

Depending on the time of day and location you check from, this result will vary anywhere from 400ms – 700ms range which is pretty fast for a homepage.

根据一天中的时间和您检查的位置,此结果的范围从400毫秒到700毫秒不等,这对于主页来说是非常快的。

Here’s a test that I ran for a single post page since it has bigger images and more content:

这是我针对单个帖子页面进行的测试,因为它具有更大的图像和更多的内容:

WPBeginner Single Posts Page Speed Test from Pingdom

We also got a perfect score of “100” in Google page speed test for desktop. Although we do have some room for improvement on mobile score.

在桌面版Google页面速​​度测试中,我们还获得了“ 100”的完美评分。 尽管我们在移动得分方面确实有待改进。

WPBeginner Google Page Speed Test

The results above are for cached pages which is what our readers and search engine bots get when they view our website. The perceived load time of WPBeginner is near instant (more on this later).

上面的结果是针对缓存页面的,这是我们的读者和搜索引擎机器人在访问我们的网站时所获得的。 WPBeginner的感知加载时间几乎是即时的(稍后会详细介绍)。

For the sake of comparison, here’s a speed test result for Gatsby’s homepage. This is a popular static site generator that a lot of developers are raving about:

为了进行比较,下面是Gatsby主页的速度测试结果。 这是一个流行的静态站点生成器,许多开发人员都在赞叹它:

Gatsby Homepage Pingdom

Here’s the speed test result of Netlify’s homepage, a popular static site host, that a lot of developers recommend. Notice that they have half the amount of requests, and their page size is 30% of WPBeginner, yet it still loads slower than our homepage.

这是许多开发人员推荐的Netlify主页(一个受欢迎的静态站点托管)的速度测试结果。 请注意,它们的请求量只有一半,其页面大小是WPBeginner的30%,但加载速度仍然比我们的主页慢。

Netlify Homepage Pingdom

The homepage speed of Contentful, the headless CMS which is “how enterprises deliver better digital experiences” is just not optimized at all. This was the slowest website we tested.

Contentful无头CMS的主页速度(即“企业如何提供更好的数字体验”)根本没有被优化。 这是我们测试过的最慢的网站。

Contentful Homepage Pingdom

I am sharing these stats not to discredit the other frameworks, but rather to give perspective that not all new things are as shiny as they may seem.

我分享这些统计数据并不是要抹黑其他框架,而是要提出观点,即并非所有新事物都像看起来那样闪亮。

WordPress with a proper hosting infrastructure and optimizations can be just as fast as any static site generator. Furthermore, no other platform will even come close to the level of flexibility that Word

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值