Use native query filters with object cache / redis object cache pro?

we are currently using facetwp plugin for filtering. we had to exclude filtered pages from object caching since they don’t work together. wondering if the native bricks filtering works with object caching (using object cache pro with relay)?

thanks

2 Likes

bump up the bump :slight_smile: !

it’ll likely be faster just to try it, and if you have issues then report a bug.

Hello! I’m using FacetWP and will run into the same issue down the line. I will need to use Redis, which is apparently incompatible with object cache. Kinsta (my host that installs Redis server-side) mentionned that i will not be able to disable it per-page… So i’m curious as to how you managed to disable it per page :slight_smile: Thanks!!

Sounds like a question for the FacetWP group, not the Bricks forum.

you can conditionally disable Redis object cache on a per-page basis through wp-config.php since it loads before WordPress initializes. The key is the WP_REDIS_DISABLED constant combined with a URL check.

Here’s the approach for wp-config.php:

php

// Disable Redis object cache on specific pages
$request_uri = $_SERVER['REQUEST_URI'] ?? '';

$disabled_pages = [
    '/shop/',
    '/products/',
    '/some-faceted-page/',
];

foreach ($disabled_pages as $page) {
    if (strpos($request_uri, $page) !== false) {
        define('WP_REDIS_DISABLED', true);
        break;
    }
}
1 Like

Thanks! I’ll give this a try! Thanks :slight_smile: KInsta told me I could not disable Redis on a per-page basis since it was installed on the environment level, but I’ll try this

The WP_REDIS_DISABLED constant works at the PHP/WordPress layer — it just tells the Redis Object Cache drop-in “don’t connect to Redis for this request.” The Redis server is still running, it’s just not being called. So there’s no conflict with Kinsta’s setup.

1 Like

Great!! Thanks a bundle