wordpress 如何在wordpress中禁用缓存

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46192524/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 11:18:16  来源:igfitidea点击:

How to disable cache in wordpress

wordpresscachingbrowser-cache

提问by A Shah

I am creating a website, but I needed to do refresh several time to see the changes I made in website. Is there any option that I can use to disable cache in WordPress?

我正在创建一个网站,但我需要刷新几次才能看到我在网站中所做的更改。是否有任何选项可用于禁用 WordPress 中的缓存?

回答by A Shah

put below code in your wp-config.php file.

将以下代码放入您的 wp-config.php 文件中。

define('WP_CACHE', false);

回答by Kilian Batzner

If you want more fine-grained control over what pages should not be cached, which ones should and for how long, etc. or you don't want to change the wp-config.phpfile, you can also try out the W3 Total Cacheplugin. I have used it for quite a while now and can recommend it.

如果您想要更细粒度地控制哪些页面不应缓存,哪些页面应该缓存以及多长时间等等,或者您不想更改wp-config.php文件,您还可以尝试W3 Total Cache插件。我已经使用它很长一段时间了,可以推荐它。

回答by droidman

Use Disable cache in google chrome developer options. Press F12, Go to Network > check disable cache.

在谷歌浏览器开发者选项中使用禁用缓存。按 F12,转到网络 > 检查禁用缓存。