我有一个页面,其中我没有通过使用此代码使用缓存:
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
现在我想知道:使用正确的链接进入此页面或使用浏览器后退按钮返回页面之间有什么区别,或者有什么方法可以检测到这一点吗?
最佳答案
没有万无一失的方法,但我的猜测是使用后退按钮时,未设置 HTTP 引荐来源网址。当然还有其他原因可能导致未设置 HTTP referer。
关于c# - 重定向到页面和按下后退按钮后进入同一页面之间的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4524458/