【发布时间】:2012-06-22 03:20:41
【问题描述】:
我有一个动态设置 iframe src 的 ASP.NET 页面:
<iframe id="specialframe" src="<%= IframeSrc %>"></iframe>
还有代码隐藏:
internal string IframeSrc { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
IframeSrc = SpecialService.GetNewUrl();
}
SpecialService 是一项第三方服务,在调用时会返回一个一次性使用 URL,如下所示:
http://www.specialservice.com/oneTimeUseId=fh8396123lkjufgh49
出于安全考虑,此 ID 在过期前只能使用一次。但是,这会导致一个问题。
第一次在浏览器中显示页面时,它会正确加载 iframe。但是,如果我点击 refresh,我会在 iframe 中收到一条错误消息,因为它正在尝试使用相同的一次性使用 ID。如果我 Ctrl+F5 刷新以强制清除缓存,它可以正常工作,但我不能告诉我的用户每次都这样做。
我的问题是,是否可以强制浏览器从不使用缓存并始终从服务器请求新副本?
【问题讨论】:
标签: c# asp.net caching browser