Support » Plugin: Redis Object Cache » Clearing the cache on post publish?

  • Resolved Daniel Quinn

    (@djquinn)


    If I want to cause this plugin to clear the Redis cache when a post is published, should I simply invoke wp_cache_flush() on a post publish hook, or should I be using one of the hooks built into the plusin? I notice redis_object_cache_flush for example but I assume this happens after the Redis cache is cleared manually/on an interval.

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

    (@tillkruess)

    Correct, just use the flush method as the action callback and it will flush the cache 👍

    It’s generally better to update the cache than flush it for performance.

    leogc

    (@leogc)

    Hi @tillkruess

    and how can the cashe ben updated insted of flushed? I a hve a news Page and we post between 2 and 22 Posts every day, so for me it would be very interesting to know how i can set the cashe the way that always after a post is publishes the cash get an update. Becaue in the moment i flush teh cashe always after a new post comes online, this is the only way i get my Pages up to date with showing the new articles.

    Plugin Author Till Krüss

    (@tillkruess)

    leogc

    (@leogc)

    Ok, i am not a programmer but as i understand it this are basic funtions which are included in the File: wp-includes/post.php, right?

    So this means i should place a Code into the Functions.php of the Theme?

    Like this one:
    update_post_caches( $posts, $post_type, $update_term_cache, $update_meta_cache );

    Or do i get something wrong?

    Plugin Author Till Krüss

    (@tillkruess)

    If you’re not technical, I’d say stick with wp_cache_flush().

    Hello @tillkruess

    youe mean this? https://developer.wordpress.org/reference/functions/wp_cache_flush/

    Still a developor site, i can place all what i need to get a result i want into CSS, or functions.php or into the WP-Config file, the only thing i need is an advice how to do it or which code. If i check <our links fpr “update” the Cache or my linke here it looks al similar to me, no idea what to do, is there no website which tell me what to do excatly if i want to update the Redis Cashe afer i do postings?

    • This reply was modified 1 week, 6 days ago by leogc.
    • This reply was modified 1 week, 6 days ago by leogc.
    • This reply was modified 1 week, 6 days ago by leogc.
    Plugin Author Till Krüss

    (@tillkruess)

    No, sorry, that varies from site to site. You can always go to Settings > Redis and click “Flush Cache” after publishing a new post.

    WordPress core does this by itself, but maybe you have another plugin that’s not working with persistent object caching.

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