• Resolved hirngesicht

    (@hirngesicht)


    Hello! I was just wondering if it’s possible to store the WP Rest Cache data in another Redis database than database 0?

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @hirngesicht

    WP REST Cache itself doesn’t talk to Redis directly — it stores everything through the WordPress Transients API (with a wp_rest_cache_ key prefix). The fact that your caches end up in Redis means you have an external object cache drop-in active (e.g. the Redis Object Cache plugin by Till Krüss, or similar), and that drop-in is what decides which Redis database is used.

    Most Redis object cache drop-ins use a single Redis database for all of WordPress and expose a WP_REDIS_DATABASE constant (in wp-config.php) to choose which one — but only one. They don’t natively support routing a subset of transients to a different DB.

    If you want WP REST Cache transients specifically in a separate Redis database, you’d need a custom/modified object cache drop-in that detects the wp_rest_cache_ key prefix (or the underlying _transient_wp_rest_cache_* option name) and opens a second Redis connection on a different DB index for those keys. That’s outside the scope of this plugin, but it’s the layer you’d need to customise.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.