Support » Plugin: Redis Object Cache » DB Queries Caching

  • Resolved bonysmoke


    I’m planning to cache slow SQL queries since, as I can see, the Redis Object Cache plugin doesn’t cache all of them.
    I want to do it not only for a specific plugin but for any slow DB query in general.
    I found a related topic where it was pointed out that I would need to write my own logic using the WP Cache functions:
    However, as I understand, WordPress will try to use the file from the wp-content/ folder for its caching mechanism (object-cache.php in this case).

    I would like to know if there is a way for me to keep using the object-cache.php file provided by the plugin and somehow expand the logic of the plugin (in a new file for example)?

    P.S. Sorry if what I wrote above doesn’t make any sense. I just couldn’t find any related topics.
    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Till Krüss


    Hi there!

    To cache database queries you’ll need to use the wp_cache_* functions, that way you can keep using this plugin.

    How do you plan on invalidating the database query cache?

    Thread Starter bonysmoke


    Thank you for the clarification!
    I was thinking about some sort of a central system to check for any updates (some events). In case of certain events, I would flush the cache. I’m fairly new to WordPress so not sure how to implement it for now:)

    Plugin Author Till Krüss


    If you find a reliable way, feel free to open a PR on GitHub and we get that merged as a feature 👍

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.