Add/remove tags on frontend programmatically

Found the solution in https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/taxonomy.php#L0

wp_add_object_terms() uses wp_cache_delete(), but wp_remove_object_terms() don’t. Just added this:

wp_remove_object_terms( $post->ID, $tag_id, 'post_tag' );
wp_cache_delete( $object_id, 'post_tag_relationships' );