• Hello,

    I have installed WP REST API Cache and it is caching the rest api. However, the cache is not getting cleared after the new post publish

    I have added the following code, but it is still not working

    add_action( 'save_post', function( $post_id ) {
      if ( class_exists( 'WP_REST_Cache' ) ) {
        WP_REST_Cache::empty_cache();
      }
    } );

    Also, when I try to delete cache manually, the newest post is not appearing on the rest API. The API is getting updated only when I disable this plugin

    Could you please let me know the reason?

  • The topic ‘Caching WP REST API – Not updating the REST API’ is closed to new replies.