Skip to content

Cache is not getting Updated after post publish #14

Open
@mksamadnet

Description

@mksamadnet

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 how I can fix this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions