我有一个actionResult,已经添加了缓存。
[OutputCache(Duration = 120)]
当我更改了页面上一些被缓存的元素时,我希望移除缓存输出。以下是我所做的:
public void RemoveCachingForProfile(string guid)
{
HttpResponse.RemoveOutputCacheItem("/Profile/" + guid);
}
当我在页面中更改某些内容时,我会通过
RemoveCachingForProfile
函数进行操作。然后,当我回到我的个人资料页面时,它仍然显示缓存中的内容,即使我已禁用它。如果我按F5,它会显示正确的输出。似乎是浏览器正在缓存页面。