Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at adding cache clearing on post update #6

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions php/class-plugin.php
Expand Up @@ -139,6 +139,15 @@ public function handle_existing_post( $post, $request ) {
$standards
);

if ( class_exists( 'Redis_Page_Cache' ) ) {
$cache = new Redis_Page_Cache();
$plugin_version = $request->get_param( 'version' );

$url_to_clear = get_rest_url( null, sprintf( 'tide/v1/audit/wporg/%s/%s/%s', $project_type, $slug, $plugin_version ) );

$cache::clear_cache_by_url( $url_to_clear );
}

// Consider this request handled!
static::$handled = true;

Expand Down