如何在WordPress中清除缓存

Recently, one of our readers asked us how to clear cache in WordPress?

最近,一位读者问我们如何清除WordPress中的缓存?

Your web browser, hosting server, and caching plugins can all serve cached content which can make it difficult for you to see the changes you made to your website right away.

您的Web浏览器,托管服务器和缓存插件都可以提供缓存的内容,这使您难以立即查看对网站所做的更改。

Clearing your WordPress cache is also the first troubleshooting advice that you’ll often hear.

清除WordPress缓存也是您经常会听到的第一个故障排除建议。

In this article, we will show you how to properly clear the cache in WordPress. We’ll cover browser cache, web hosting cache, and top WordPress caching plugins in this guide.

在本文中,我们将向您展示如何正确清除WordPress中的缓存。 在本指南中,我们将介绍浏览器缓存,网络托管缓存和顶级WordPress缓存插件。

How to clear cache in WordPress
什么是缓存,何时需要清除缓存? (What is Cache and When Do You Need to Clear Cache?)

Caching solutions store a static version of your website. This allows WordPress to skip running the heavier PHP scripts and improve your website speed.

缓存解决方案存储您网站的静态版本。 这使WordPress可以跳过运行较重PHP脚本并提高网站速度

How caching works in WordPress

There are many different type of caching solutions available. The most popular ones are WordPress caching plugins like WP Rocket and WP Super Cache.

有许多不同类型的缓存解决方案可用。 最受欢迎的是WordPress缓存插件,例如WP RocketWP Super Cache

These plugins offer an easy to use interface for controlling what to cache, when to expire cached content, and cleaning up cache on demand.

这些插件提供了一个易于使用的界面,用于控制缓存内容,缓存内容何时过期以及按需清理缓存。

Managed WordPress hosting providers like WP Engine also run their own caching solutions, so that you don’t have to install a caching plugin.

诸如WP Engine之类的托管WordPress托管提供程序也运行其自己的缓存解决方案,因此您不必安装缓存插件。

If you are using a CDN service like MaxCDN, then they would also serve cached copies of static content.

如果您使用的是像MaxCDN这样的CDN服务 ,那么它们还将提供静态内容的缓存副本。

If you’re using a web application firewall like Sucuri or CloudFlare to improve your WordPress security, then they also have their own cache to speed up your site and reduce downtime.

如果您正在使用SucuriCloudFlare之类的Web应用程序防火墙来提高WordPress的安全性 ,那么它们还具有自己的缓存来加快您的站点并减少停机时间。

Lastly, most modern web browsers will also store cached versions of pages on your computer.

最后,大多数现代网络浏览器还将在计算机上存储页面的缓存版本。

The purpose of caching is to speed up the website and improve overall user experience. However, sometimes this causes you to not see the changes you make right away which can be frustrating. In that case, you will need to clear caches to see your changes live.

缓存的目的是加快网站速度并改善整体用户体验。 但是,有时这会导致您看不到您立即进行的更改,这可能令人沮丧。 在这种情况下,您将需要清除缓存以实时查看所做的更改。

Having said that, let’s take a look at how to clear your cache in WordPress.

话虽如此,让我们看一下如何清除WordPress中的缓存。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

步骤1:清除浏览器缓存 (Step 1: Clear Your Browser Cache)

First, you need to clear your web browser cache. Most web browsers can store static content like stylesheets, JavaScript, images from a website to make your subsequent visits faster.

首先,您需要清除Web浏览器缓存。 大多数网络浏览器可以存储静态内容,例如样式表,JavaScript,网站图像,以使您的后续访问更快。

However, sometimes web browsers may fail to realize that a web page has changed. Instead of fetching a fresh copy, they may still reload the page from the cached version stored on your computer.

但是,有时Web浏览器可能无法意识到网页已更改。 他们可能仍未从计算机上存储的缓存版本中重新加载页面,而不是获取新副本。

Here is how you will clean your browser cache in Google Chrome. First, you need to click on the menu icon and then select More Tools » Clear Browsing Data.

这是在Google Chrome浏览器中清理浏览器缓存的方法。 首先,您需要单击菜单图标,然后选择更多工具»清除浏览数据

Clear cache in Google Chrome

This will bring up a popup where you can select the content you want to remove. Make sure that cached images and files option is checked and then click on the ‘Clear browsing data’ button.

这将弹出一个弹出窗口,您可以在其中选择要删除的内容。 确保选中了“缓存的图像和文件”选项,然后单击“清除浏览数据”按钮。

Clear browsing data in Google Chrome

You have successfully cleared your browser cache, and you can now try visiting your website. For more details, see our guide on how to clear cache in all major browsers.

您已成功清除浏览器缓存,现在可以尝试访问您的网站。 有关更多详细信息,请参见有关如何在所有主要浏览器中清除缓存的指南。

If you are still not seeing the changes you made, then move on to the next steps in this article.

如果仍然看不到所做的更改,请继续执行本文中的后续步骤。

步骤2:清除WordPress缓存插件中的缓存 (Step 2: Clear Cache in Your WordPress Caching Plugin)

If you are using a WordPress caching plugin on your site, then you need to clear your plugin cache. Most caching plugins allow you to easily do that from the plugin’s Settings page.

如果您在网站上使用WordPress缓存插件,则需要清除插件缓存。 大多数缓存插件使您可以从插件的“设置”页面轻松地执行此操作。

Clear Cache in WP Rocket

清除WP Rocket中的缓存

WP Rocket is the best WordPress caching plugin on the market. The best part about using WP Rocket is that it proactively builds your WordPress cache in the background, so your users are always served a cached version.

WP Rocket是市场上最好的WordPress缓存插件 。 使用WP Rocket最好的部分是它会在后台主动构建WordPress缓存,因此始终为您的用户提供缓存版本。

It also makes it very easy to clear caches files with a single click.

这也使单击鼠标清除缓存文件变得非常容易。

Simply go to the Settings » WP Rocket page and click on the ‘Clear Cache’ button under the dashboard tab.

只需转到“ 设置»WP火箭”页面,然后单击仪表板选项卡下的“清除缓存”按钮。

Clear WP Rocket cache

WP Rocket will now clear all cached files for you.

WP Rocket现在将为您清除所有缓存的文件。

Clear Cache in WP Super Cache

清除WP Super Cache中的缓存

WP Super Cache is a popular WordPress caching plugin. It allows you to clean or purge all cached content with a single click.

WP Super Cache是一个流行的WordPress缓存插件。 它使您只需单击即可清除或清除所有缓存的内容。

You need to visit Settings » WP Super Cache page and click on ‘Delete Cache’ button.

您需要访问设置»WP Super Cache页面,然后单击“删除缓存”按钮。

Delete cache in WP Super Cache

That’s all, WP Super Cache will now delete all cached files from your website.

就是这样,WP Super Cache现在将删除您网站上的所有缓存文件。

Clear Cache in W3 Total Cache

清除W3总缓存中的缓存

W3 Total Cache is another popular WordPress caching plugin. It also makes it super easy to clear cache with one click.

W3 Total Cache是​​另一个流行的WordPress缓存插件。 一键清除缓存也非常容易。

Head over to Performance » Dashboard page and click on ’empty all caches button.

转到性能»仪表板页面,然后单击“清空所有缓存”按钮。

Empty cache in W3 Total Cache

W3 Total Cache will now delete all cached content for your site.

W3 Total Cache现在将删除您网站的所有缓存内容。

清除WP Engine上的缓存 (Clear Cache on WP Engine)

WP Engine is a managed WordPress hosting provider. They run their own caching solution, so their customers don’t need to install a caching plugin.

WP Engine托管的WordPress托管提供商。 他们运行自己的缓存解决方案,因此他们的客户不需要安装缓存插件。

If you are unable to notice changes take effect immediately, then you can easily clear WP Engine cache from your WordPress admin area.

如果您无法注意到更改立即生效,则可以轻松地从WordPress管理区域中清除WP Engine缓存。

You need to click on the WP Engine menu item in the admin bar and then under ‘General’ settings click on purge all caches button.

您需要单击管理栏中的WP Engine菜单项,然后在“常规”设置下单击“清除所有缓存”按钮。

Clear WP Engine cache

WP Engine will now purge all stored cache for your WordPress site.

WP Engine现在将清除WordPress网站的所有存储的缓存。

清除Bluehost上的缓存 (Clear Cache on Bluehost)

Bluehost is one of the best WordPress hosting companies in the business. They offer a built-in caching solution that instantly improves your WordPress performance and speed.

Bluehost是业界最佳的WordPress托管公司之一。 他们提供了内置的缓存解决方案,可立即提高WordPress的性能和速度。

You can clear your Bluehost WordPress cache from WordPress admin area.

您可以从WordPress管理区域清除Bluehost WordPress缓存。

Simply login to your WordPress admin area and you will notice a ‘Caching’ button in the admin tool bar. Take your mouse over and you’ll see the option to ‘Purge All’ cache.

只需登录到您的WordPress管理区域,您将在管理工具栏中看到一个“缓存”按钮。 将鼠标移到上方,您将看到“清除所有”缓存的选项。

Clear WordPress cache in Bluehost

Bluehost will now clear all files from their WordPress cache.

Bluehost现在将从其WordPress缓存中清除所有文件。

清除SiteGround中的缓存 (Clear Cache in SiteGround)

SiteGround is a leading WordPress hosting provider that’s known for speed and top-notch customer support. They offer a built-in caching solution to improve your website performance.

SiteGround是领先的WordPress托管提供商,以快速和一流的客户支持而闻名。 他们提供了内置的缓存解决方案来改善您的网站性能。

You can clear SiteGround cache from your hosting account control panel as well as the WordPress admin area. We’ll show you both methods.

您可以从托管帐户控制面板以及WordPress管理区域中清除SiteGround缓存。 我们将向您展示这两种方法。

Clear SiteGround cache from your hosting dashboard

从托管仪表板清除SiteGround缓存

Login to your hosting account dashboard go to Speed » Caching page under site tools.

登录到您的托管帐户仪表板,转到网站工具下的Speed»Caching页面。

From here, switch to the Dynamic cache tab. Click on the menu icon next to your domain name and then select Flush cache option.

从此处切换到“动态缓存”选项卡。 单击域名旁边的菜单图标,然后选择“刷新缓存”选项。

Clear cache on SiteGround

Clear SiteGround cache from WordPress admin dashboard

从WordPress管理仪表板清除SiteGround缓存

You can also manage SiteGround cache by installing and activating the SG Optimizer plugin. For more details, see our step by step guide on how to install a WordPress plugin.

您还可以通过安装和激活SG Optimizer插件来管理SiteGround缓存。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, you need to click on the Purge SG Cache button in the WordPress admin toolbar.

激活后,您需要单击WordPress管理工具栏中的Purge SG Cache按钮。

Purge SiteGround cache

The plugin will now clear your SiteGround WordPress cache.

现在,该插件将清除您的SiteGround WordPress缓存。

清除Sucuri中的缓存 (Clear Cache in Sucuri)

If you’re using a WordPress firewall like Sucuri to protect your website, then they also have their own layer of caching.

如果您使用诸如Sucuri之类的WordPress防火墙来保护您的网站,则它们也具有自己的缓存层。

You can clear the cache from your Sucuri plugin by going to Sucuri » WAF menu in your WordPress admin area.

您可以转到WordPress管理区域中的Sucuri»WAF菜单,从Sucuri插件中清除缓存。

Sucuri Clear Cache

Bonus Tip: If you have recently moved your WordPress website, then you may also need to clear your DNS cache. This will ensure that you are getting the updated DNS information and accessing the newer version of your website.

温馨提示 :如果您最近移动了WordPress网站,则可能还需要清除DNS缓存 。 这将确保您获取更新的DNS信息并访问网站的更新版本。

We hope this article helped you learn how to clear cache in WordPress. You may also want to see our guide on how to boost WordPress speed and performance.

我们希望本文能帮助您学习如何清除WordPress中的缓存。 您可能还想查看有关如何提高WordPress速度和性能的指南

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值