禁止页面缓存数据的方法分享
有时候可能我们不需要网页缓存数据,而是要实时从服务器更新最新的内容,下面就简单介绍一下能够实现此功能的代码,希望能够给需要的朋友带来一定的帮助。 实现方法一: 1 2 3 4 5 < head > < meta http-equiv = "Pragma" content = "no-cache" > < meta http-equiv = "Cache-Control" content = "no-cache" > < meta http-equiv = "Expires" content = "0" > </ head > 在网页的头部添加如下元素。 实现方法二: 1 2 3 4 5 Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "No-Cache" 上面的代码是ASP使用的方式,可以...