Yes - the way Sitecore does it by adding user data to the cache key for rendering. This storage is in the html cache, so to clear it you need to get the html cache and clear all entries containing the username.
This snippet will do this:
// Need to clear the cache for the header and the user profile....
var htmlCache = CacheManager.GetHtmlCache(Context.Site);
// Remove all cache keys that contain the currently logged in user.
var cacheKey = $"#login:True_#user:{Context.GetUserName()}";
htmlCache.RemoveKeysContaining(cacheKey);
This clears all entries in the html cache for the current user. If you want to clear for another user, just change Context.GetUserName()to get the specific user that you want to clear.
source
share