Skip to content

Feature Request: Add a filter/configuration to disable cache on queries #139

@engahmeds3ed

Description

@engahmeds3ed

I know that using cache for queries is very important and makes the process faster but we have a case that we need to disable it for one query.

The case is that we have a code that inserts multiple fake posts on the same request and with pre_post_update hook we have our callback to make a query to make sure that we don't have a record with some criteria to do action with it so when the cache is enabled, it inserts the first one and with the second one the query gets the data from the cache.

We temporary can solve that by using the following hook
https://github.com/berlindb/core/blob/master/src/Database/Query.php#L871

then use the WP function wp_cache_flush but this will flush the whole cache :(

I know that you try to eliminate having short circuit filter into the plugin so we may have an argument to disable the cache with default value is false.

If u agree I can start PR for this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions