You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
useDwnload\WpRestApi\RestApi\RestDispatch;add_action( RestDispatch::ACTION_CACHE_SKIPPED,function($result,\WP_REST_Server$server,\WP_REST_Request$request ) {// Do something here, like create a log entry using Wonolog.},10,3 );
useDwnload\WpRestApi\WpAdmin\Admin;add_action( Admin::ACTION_REQUEST_FLUSH_CACHE,function($message,$type,WP_User$user ) {// Do something here, like create a log entry using Wonolog.},10,3 );
Soft delete:AppendRestDispatch::QUERY_CACHE_DELETE to your query param:add_query_arg( [ RestDispatch::QUERY_CACHE_DELETE, '1' ], '<url>' ). soft delete will delete the cache after the current request completes (on WordPress shutdown).
Hard delete: AppendRestDispatch::QUERY_CACHE_DELETE &&RestDispatch::QUERY_CACHE_FORCE_DELETE to your query param:add_query_arg( [ RestDispatch::QUERY_CACHE_DELETE, '1', RestDispatch::QUERY_CACHE_FORCE_DELETE, '1' ], '<url>' ). hard delete will delete the cache before the request, forcing it to repopulate.
empty ALL cache on post-savethis is not ideal
You can use the WordPress filtersave_post if you would like to emptyALL cache on post save.