Database Cache: How to “whitelist” exact queries to be cached
-
Hi all,
I want to activate the Database Cache in W3TC, even for logged in users, on our Buddypress Membershpi page. Therefore I need so technically understand a few things. I’d love to only “whitelist” specific queries which I know run over and over again and always return the same result. My current problem is: I can’t maintain all my caching patches across the different plugins, hence I’m looking to therefore feed the DB results into an persistent cache at the “last place” before it goes to the Database.
Is something like that possible using W3TC (whitelisting the desired queries to be cached)?
And is my understanding correct, that the functionality would work this way (quite similar to the object cache which already uses wp_cache_set/get): Instead of querying the database, the wpdb dropin class would make use of wp_cache_set/get, which in turn would basically use the persistent object cache (like memcached/redis)?
In case it’d be possible to first record all running queries (with a run-counter) and afterwards to define my own query whitelist, this would be awesome. Because it would enable be to feed the database results to the object cache for a defined period of time and enable me to use this across all queries (no matter where they are originally coming from).
Thanks so much!
- You must be logged in to reply to this topic.