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.
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.
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?
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.
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.