| 开发者 | apunker |
|---|---|
| 更新时间 | 2026年6月27日 10:56 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp_cache_*, transients) starts using Redis. No theme or plugin changes./run/redis/redis.sock, logical database 1. Nothing to type — no host, port, or password.redis PHP extension is present it is used automatically; if not (the Jabali default), the plugin falls back to a dependency-free, pure-PHP RESP client over the same socket. Either way it just works.allkeys-lru policy, so it may evict keys at any time. Every read is best-effort — an evicted or missing key simply falls through to the database. An eviction is never an error.object-cache.php automatically.jabali-cache folder to wp-content/plugins/ (or install the zip from Plugins → Add New).wp-config.php (see the FAQ). Over a unix socket or TCP both work.On the Jabali panel, socket access is set up when you enable caching for the site (Applications → cache toggle). If the status still shows Not reachable, re-run that toggle. On a standalone host, the site's PHP-FPM user needs two things for a unix socket:
/run/redis (or wherever your socket lives) to the pool's open_basedir.No. It auto-detects phpredis and uses it when available; otherwise it uses a built-in pure-PHP client. You get persistent caching either way.
Define overrides in wp-config.php. With none of these set, it defaults to the Jabali socket and a per-site prefix.
define( 'JABALI_CACHE_SOCKET', '/path/to/redis.sock' ); — unix socket, or:
define( 'JABALI_CACHE_HOST', '127.0.0.1' );
define( 'JABALI_CACHE_PORT', 6379 );
Optional:
define( 'JABALI_CACHE_DB', 1 ); — logical database number
define( 'JABALI_CACHE_PASSWORD', '...' ); — Redis AUTH password
define( 'JABALI_CACHE_PREFIX', 'mysite' ); — key prefix (auto-derived per site if unset)
define( 'JABALI_CACHE_DISABLED', true ); — force off without deactivating
Yes. Each install uses a unique key prefix, so reads, writes, and flushes are scoped to your site only. One site cannot see or clear another's cache, even though they may share the same Redis database.
Yes. The expected policy is allkeys-lru — Redis evicts least-recently-used keys when full. Every read in this plugin is best-effort, so an evicted key just rebuilds from the database. There is no error path that can break the site under memory pressure.
Yes. Per-site cache data is namespaced per blog, while truly global cache groups are shared across the network as WordPress expects.
Only if your host does not already have one. On Jabali, nginx serves a FastCGI microcache at the edge, which is faster than caching in PHP — so the WordPress page cache stays off by default to avoid double-caching. Off Jabali, you can enable it from the settings screen.
wp jabali-cache status # connection, driver, prefix, key count, page-cache state wp jabali-cache flush # flush this site's object cache wp jabali-cache flush --pages # also purge page-cache entries wp jabali-cache enable # enable caching wp jabali-cache disable # disable caching wp jabali-cache update-dropins # (re)install the wp-content drop-ins wp jabali-cache remove-dropins # remove the drop-ins wp jabali-cache diagnose # full connectivity + environment report
Deactivating removes the object-cache.php drop-in cleanly, so WordPress reverts to its built-in non-persistent cache. Uninstalling removes the plugin's options. Your Redis data is just a cache and is safe to discard.