Linux 软件免费装
Banner图

WP Redis

开发者 getpantheon
danielbachhuber
mboynes
Outlandish Josh
jspellman
jazzs3quence
更新时间 2023年11月28日 03:32
PHP版本: 3.0.1 及以上
WordPress版本: 6.4.1
版权: GPLv2 or later
版权网址: 版权信息

标签

cache plugin redis

下载

1.4.4 1.3.5 0.1 0.2.0 1.1.1 0.2.2 0.3.0 0.4.0 0.5.0 0.6.0 0.6.1 0.6.2 0.7.0 0.7.1 0.8.0 0.8.2 0.8.3 1.1.0 1.1.2 1.1.4 1.2.0 1.3.0 1.3.1 1.0.1 0.8.1 1.0.0 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 0.2.1 1.4.2 1.4.3

详情介绍:

对于需要处理高流量、提高登录用户访问速度或动态页面负载的网站来说,高速持久的对象缓存是必不可少的。此外,您还需要能在应用程序的多个实例中进行扩展的缓存,因此不能使用本地文件缓存或 APC。 Redis is a great answer, and one we bundle on the Pantheon platform. This is our plugin for integrating with the cache, but you can use it on any self-hosted WordPress site if you have Redis. Install from WordPress.org or Github. 值得注意的是,持久化对象缓存并非万能--页面加载时调用 2,000 次 Redis,就相当于进行了整整 2 秒钟的对象缓存事务处理。请确保明智地使用对象缓存:保持合理的键数,不要在每个键上存储大量数据,并避免前端急速写入和删除。 Go forth and make awesome! And, once you've built something great, send us feature requests (or bug reports). Take a look at the wiki for useful code snippets and other tips.

安装:

This assumes you have a PHP environment with the required PhpRedis extension and a working Redis server (e.g. Pantheon). WP Redis also works with Predis via humanmade/wp-redis-predis-client.
  1. Install object-cache.php to wp-content/object-cache.php with a symlink or by copying the file.
  2. 如果不是在 Pantheon 上运行,请编辑 wp-config.php,添加缓存证书,例如
$redis_server = array( 'host' => '127.0.0.1', 'port' => 6379, 'auth' => '12345', 'database' => 0, // Optionally use a specific numeric Redis database. Default is 0. ); 3. If your Redis server is listening through a sockt file instead, set its path on host parameter and change the port to null: $redis_server = array( 'host' => '/path/of/redis/socket-file.sock', 'port' => null, 'auth' => '12345', 'database' => 0, // Optionally use a specific numeric Redis database. Default is 0. ); 4. 启动推进器:现在您正在使用 Redis 支持 WP 的对象缓存。 5. (Optional) To use the wp redis WP-CLI commands, activate the WP Redis plugin. No activation is necessary if you're solely using the object cache drop-in. 6. (Optional) To use the same Redis server with multiple, discreet WordPress installs, you can use the WP_CACHE_KEY_SALT constant to define a unique salt for each install. 7. (Optional) To use true cache groups, with the ability to delete all keys for a given group, register groups with wp_cache_add_redis_hash_groups(), or define the WP_REDIS_USE_CACHE_GROUPS constant to true to enable with all groups. However, when enabled, the expiration value is not respected because expiration on group keys isn't a feature supported by Redis. 8. (Optional) On an existing site previously using WordPress' transient cache, use WP-CLI to delete all (%_transient_%) transients from the options table: wp transient delete-all. WP Redis assumes responsibility for the transient cache. 9. (Optional) To use Relay instead of PhpRedis as the client define the WP_REDIS_USE_RELAY constant to true. For support requests, please use Relay's GitHub discussions.

升级注意事项:

1.4.0 WP Redis 1.4.0 adds support for the flush_runtime and flush_group functions. If you've copied object-cache.php and made your own changes, be sure to copy these additions over as well.

常见问题:

我为什么要使用这个插件?

如果您担心网站的运行速度,那么使用高性能的持久对象缓存来支持网站会产生巨大的影响。它可以减轻数据库的负担,更快地加载 WordPress 运行所需的所有数据对象。

如何与其他缓存插件配合使用?

该插件用于内部应用程序对象缓存。它与页面缓存无关。在 Pantheon 上,你不需要额外的页面缓存,但如果你是自托管,你可以使用你喜欢的页面缓存插件与 WP Redis 结合使用。

如何禁用不良行为者的持久对象缓存?

一个页面的加载需要调用 2,000 次 Redis,而对象缓存事务则需要整整 2 秒钟。如果您正在使用的插件错误地创建了大量缓存键,您可以通过禁用插件组的缓存持久性来缓解问题: wp_cache_add_non_persistent_groups( array( 'bad-actor' ) ); This declaration means use of wp_cache_set( 'foo', 'bar', 'bad-actor' ); and wp_cache_get( 'foo', 'bad-actor' ); will not use Redis, and instead fall back to WordPress' default runtime object cache.

为什么对象缓存有时会与数据库不同步?

There's a known issue with WordPress alloptions cache design. Specifically, a race condition between two requests can cause the object cache to have stale values. If you think you might be impacted by this, review this GitHub issue for links to more context, including a workaround.

Where do I report security bugs found in this plugin?

Please report security bugs found in the source code of the WP Redis plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment, and notify the developers of this plugin.

更新日志:

1.4.4 (November 27, 2023) 1.4.3 (June 26, 2023) 1.4.2 (May 15, 2023) 1.4.1 (May 11, 2023) 1.4.0 (May 9, 2023) 1.3.5 (April 6, 2023) 1.3.4 (March 7, 2023) 1.3.3 (February 28, 2023) 1.3.2 (December 5, 2022) 1.3.1 (December 2, 2022) 1.3.0 (November 29, 2022) 1.2.0 (February 17, 2022) 1.1.4 (October 21, 2021) 1.1.3 (October 21, 2021) 1.1.2 (March 24, 2021) 1.1.1 (August 17, 2020) 1.1.0 (July 13, 2020) 1.0.1 (April 14, 2020) 1.0.0 (March 2, 2020) 0.8.3 (February 24, 2020) 0.8.2 (January 15, 2020) 0.8.1 (January 10, 2020) 0.8.0 (January 6, 2020) 0.7.1 (December 14, 2018) 0.7.0 (August 22, 2017) 0.6.2 (June 5, 2017) 0.6.1 (February 23, 2017) 0.6.0 (September 21, 2016) 0.5.0 (April 27, 2016) 0.4.0 (March 23, 2016) 0.3.0 (February 11, 2016) 0.2.2 (November 24, 2015) 0.2.1 (November 17, 2015) 0.2.0 (November 17, 2015) 0.1