wordpress打开缓存
This article is part of a series created in partnership with SiteGround. Thank you for supporting the partners who make SitePoint possible.
本文是与SiteGround合作创建的系列文章的一部分。 感谢您支持使SitePoint成为可能的合作伙伴。
You know you need a fast website. Your visitors don’t want to wait, Google rewards speed, and you just want to create the best site you can.
您知道您需要一个快速的网站。 您的访客不想等待,Google会奖励您更快的速度,而您只想创建一个最佳网站即可。
We previously talked about some strategies for speeding your site in our article How to Optimize Your WordPress Site’s Performance. One key strategy we covered in that article is caching.
我们之前在文章如何优化WordPress网站的性能中讨论了一些加快网站速度的策略。 我们在那篇文章中介绍的一项关键策略是缓存。
Once you start googling the topic, you find that it becomes quite complex, and there are a lot of caching solutions out there. Which one should you choose?
开始搜索该主题后,您会发现它变得非常复杂,并且那里有很多缓存解决方案。 您应该选择哪一个?
In this article we’ll explain the options and help you make a decision.
在本文中,我们将解释选项并帮助您做出决定。
There are a lot of benefits to using WordPress for your website. It’s easy to add new posts, tweak the way your site looks, and add new functionality. It’s definitely the way to go, and why it’s the most popular CMS in the world, powering almost 75 million sites, or over 25% of the web.
在您的网站上使用WordPress有很多好处。 添加新帖子,调整网站外观以及添加新功能很容易。 这绝对是必经之路,也是为什么它成为全球最受欢迎的CMS,可为将近7500万个网站或超过25%的网站提供支持。
But all of that convenience comes at a price. Your web site has more work to do when someone visits your site, making it slower. Scripts need to be run, your database accessed, your theme displayed, your plugins run.
但是所有这些便利都是有代价的。 当有人访问您的网站时,您的网站需要做更多的工作,因此速度变慢。 需要运行脚本,访问数据库,显示主题,运行插件。
Caching changes all that.
缓存改变了这一切。
A cache is a place to store temporary data. It takes your dynamic, easy-to-change website, and stores it as static HTML files, which are much faster to read. Each time your site is modified, the cache needs to be cleared and regenerated, which is normally triggered by a WordPress plugin.
缓存是存储临时数据的地方。 它可以将您的动态网站,易于更改的网站存储为静态HTML文件,这些文件的读取速度更快。 每次修改站点时,都需要清除并重新生成缓存,这通常是由WordPress插件触发的。
There are three major benefits to using a WordPress cache:
使用WordPress缓存有三个主要好处:
So, should you be using a WordPress caching solution? For most people the answer is a resounding “Yes!” It’s the one thing you can do that give a huge performance boost to your site, especially when you have high traffic.
那么,您应该使用WordPress缓存解决方案吗? 对于大多数人来说,答案是肯定的“是!” 这是您可以做的一件事,它可以极大地提高网站的性能,尤其是在流量较高的情况下。
When shouldn’t you use a cache? When you want your site to display differently to each visitor. One example is an ecommerce site, where the shopping cart will be updated differently for each user.
您什么时候不应该使用缓存? 当您希望网站向每个访问者显示不同的内容时。 一个示例是电子商务站点,在该站点中,每个用户的购物车都将进行不同的更新。
But these are special cases. For most WordPress sites a cache is a great idea.
但是这些是特殊情况。 对于大多数WordPress网站而言,缓存是个好主意。
So where do you get one? There are two options: pre-packaged, or roll your own.
那你从哪儿得到的呢? 有两种选择:预包装或自己包装。
Some hosting providers have their own custom caching solution, which may involve server-side software plus custom WordPress plugins. These are carefully tweaked to maximize the speed improvement.
一些托管服务提供商拥有自己的自定义缓存解决方案,其中可能涉及服务器端软件以及自定义WordPress插件。 这些都经过仔细调整,以最大程度地提高速度。
If your provider offers such a solution, strongly consider using it. Not only will it save you time and effort, but you’re unlikely to match their results in tuning the cache for maximum speed.
如果您的提供商提供了这样的解决方案,则强烈考虑使用它。 它不仅可以节省您的时间和精力,而且在调整缓存以达到最大速度时,您不太可能匹配它们的结果。
Some examples:
一些例子:
SiteGround’s caching solution is SuperCacher, which is based on NGINX (“Engine X”). It supports HTTPS and is claimed to make your pages load four times faster:
SiteGround的缓存解决方案是SuperCacher ,它基于NGINX (“ Engine X”)。 它支持HTTPS,据称可使您的页面加载速度提高四倍:
The SuperCacher is developed by SiteGround exclusively for our customers. It increases the number of hits a site can handle and boosts the website loading speed. The SuperCacher includes 4 different caching options for maximum optimization of your websites.
SuperCacher由SiteGround专为我们的客户开发。 它增加了网站可以处理的点击次数,并提高了网站的加载速度。 SuperCacher包括4种不同的缓存选项,可最大程度地优化您的网站。
It’s a suite of four different caching solutions (well, actually three for shared hosting):
它是由四个不同的缓存解决方案组成的套件(嗯,实际上是三个用于共享托管):
For best results on your WordPress site, enable all three.
为了在WordPress网站上获得最佳效果,请同时启用这三个功能。
WP Engine call their caching solution Evercache, which is set up and ready to go out of the box. They describe it as their “secret sauce”, and claim will load pages 4-6 times faster. They recommend you don’t use your own caching solution. In fact, they explicitly block the use of many caching plugins.
WP Engine称他们的缓存解决方案Evercache ,它已经设置好并且可以直接使用。 他们将其描述为“秘密调味料”,并声称将页面加载速度提高了4-6倍。 他们建议您不要使用自己的缓存解决方案。 实际上,它们显式地阻止了许多缓存插件的使用。
Because of WP Engine’s EverCache, there is no need for site owners or developers to manage caching plugins. WP Engine takes care of that for you.
由于使用了WP Engine的EverCache,因此站点所有者或开发人员无需管理缓存插件。 WP Engine会为您解决这一问题。
Varnish is a caching solution used by many hosting providers including Bluehost and DreamHost, and it may be part of WP Engine’s secret sauce. It’s fast, but has a major limitation: it doesn’t support HTTPS. Some hosting providers run it in conjunction with NGINX or other software to get around this limitation.
Varnish是许多托管服务提供商(包括Bluehost和DreamHost)使用的缓存解决方案,它可能是WP Engine的秘密武器。 它的速度很快,但有一个主要限制:它不支持HTTPS。 一些托管服务提供商将其与NGINX或其他软件一起运行以解决此限制。
Does your hosting provider offer a caching solution out of the box? Check it out before deciding to install your own cache—it can make your job a lot easier. In fact, one good reason to choose a hosting provider is because they offer a fast and easy-to-use caching solution.
您的托管服务提供商是否提供开箱即用的缓存解决方案? 在决定安装自己的缓存之前先进行检查-它可以使您的工作轻松得多。 实际上,选择托管服务提供商的一个很好的理由是,因为它们提供了一种快速且易于使用的缓存解决方案。
If your hosting provider doesn’t provide a caching solution, or you prefer a more DIY approach, you can install a WordPress caching plugin. As a bonus, many of these have features beyond just caching, using techniques we described in our article How to Optimize Your WordPress Site’s Performance.
如果您的托管服务提供商不提供缓存解决方案,或者您更喜欢DIY方法,则可以安装WordPress缓存插件。 值得一提的是,其中许多功能不仅仅具有缓存功能,还使用了我们在如何优化WordPress网站的性能中介绍的技术 。
Which plugin should you use? Firstly, one that will give you a significant speed boost. Secondly, one that will meet your preference of configurability or ease-of-use. Thirdly, consider cost.
您应该使用哪个插件? 首先,它将大大提高速度。 其次,将满足您对可配置性或易用性的偏爱。 第三,考虑成本。
Two independent benchmark tests done earlier this year (by Design Bombs and Dev Shed) agree on the fastest three WordPress caching plugins out there. They rank the plugins differently, and debates about the best or fastest plugin are fierce and never-ending. But these three perform well, and one of them should do the trick for you.
今年早些时候完成了两项独立的基准测试(由Design Bombs和Dev Shed进行了测试 ),它们对速度最快的三个WordPress缓存插件达成了共识。 他们对插件的排名不同,关于最好或最快的插件的争论激烈而永无止境。 但是这三者表现良好,其中之一应该可以帮到您。
Don’t waste your time struggling with complex plugin settings. WP Rocket launches upon activation – minimal configuration, immediate results.
不要因为复杂的插件设置而浪费时间。 WP Rocket激活后即启动-最少的配置,立即产生效果。
Features:
特征:
This plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.
该插件从动态WordPress博客生成静态html文件。 生成html文件后,您的网络服务器将提供该文件,而不是处理相对较重且更昂贵的WordPress PHP脚本。
The plugin serves cached files in three ways, and is fast and easy to set up. It’s recommended that most users should enable the following settings:
该插件通过三种方式提供缓存的文件,并且设置简便快捷。 建议大多数用户应启用以下设置:
W3 Total Cache improves the SEO and user experience of your site by increasing website performance, reducing download times via features like content delivery network (CDN) integration.
W3 Total Cache通过提高网站性能,通过内容交付网络(CDN)集成等功能来减少下载时间,从而改善了网站的SEO和用户体验。
This plugin does more than just caching—it has a feature set similar to WP Rocket. According to the website, those features provide the following benefits:
该插件不仅可以缓存,还具有类似于WP Rocket的功能集。 根据该网站,这些功能具有以下优点:
Which caching option is best for you? The one that gives you the best balance of:
哪种缓存选项最适合您? 使您达到以下最佳平衡的一种:
Here are our recommendation.
这是我们的建议。
If your web host provides a caching solution, strongly consider using it, especially if you value ease of use. SiteGround, our preferred hosting provider, packages an excellent caching solution into their affordable hosting plans, and would be an excellent choice.
如果您的Web主机提供了缓存解决方案,则强烈考虑使用它,尤其是在您重视易用性的情况下。 我们首选的托管服务提供商 SiteGround将出色的缓存解决方案打包到其负担得起的托管计划中,将是绝佳的选择。
Which caching solution do you prefer? Why? Did we leave out your favorite? Let us know in the comment section below.
您更喜欢哪种缓存解决方案? 为什么? 我们是否遗漏了您的最爱? 在下面的评论部分让我们知道。
翻译自: https://www.sitepoint.com/choose-wordpress-caching-solution/
wordpress打开缓存