• Resolved wpshushu

    (@wpshushu)


    When object cache is enabled, do all SELECT statement results are cached and fetching of those results are redirected to Redis or just ones for triansients?

    What if a database record is updated, for example an option value in wp_options is changed, will the update automatically invalidate the cached value in Redis?

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

    (@tillkruess)

    No, not all SELECT sql queries are cached. WordPress itself determines which queries are cached and when they are invalidated.

    If you run any insert, update and delete queries they are never cached. You must use WordPress’ API function to update and retrieve information. Like get_post() and update_post().

    Thread Starter wpshushu

    (@wpshushu)

    Can a cached object fail to invalidate when it should?

    For example, when a plugin changes the value of an option in wp_options via standard WP API (I suppose update_option(…) in this case), is it guaranteed that the corresponding cached object(s) – ones that involve this option key will be invalidated immediately?

    • This reply was modified 1 year, 5 months ago by wpshushu.
    Plugin Author Till Krüss

    (@tillkruess)

    Can a cached object fail to invalidate when it should?

    Yes, some 3rd party plugins are poorly made and it may fail.

    For example, when a plugin changes the value of an option in wp_options via standard WP API (I suppose update_option(…) in this case), is it guaranteed that the corresponding cached object(s) – ones that involve this option key will be invalidated immediately?

    No, all the *_option() function will correctly update the cache. In fact all core-wp function work great with object caches: https://developer.www.ads-software.com/reference/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘cache invalidation’ is closed to new replies.