Hi Richard! Thanks for answering.
About the post type, it was just an example of what is happening. Actually I need to clear cache of more than one custom post type.
For this reason, I tried to use the two ways above and the behavior was that of the attached image.
I’ll try to change the approach a little, but what I do in my CRON is to give an update_field(), because I’m using ACF to update the values I need, I don’t use save_post().
For example:
update_field('potencial', 0, $post_id);
Once the update is done, I call for each post type:
\WP_REST_Cache_Plugin\Includes\Caching\Caching::get_instance()->delete_related_caches($post_id, post_type);
\WP_Rest_Cache_Plugin\Includes\Caching\Caching::get_instance()->delete_object_type_caches(post_type);
Do you have any other suggestions of what I can do?
Thanks,