aspx 页面没有在浏览器上缓存

aspx page not getting cached on the browser

无论我做什么,我似乎都无法在浏览器本地缓存我的 aspx 页面。登录后对页面的第一个请求转到服务器并从那里检索它。从第二个请求开始,页面从本地缓存中获取。但是,一旦我注销并重新登录,相同的页面就会再次从服务器获取,而不是从本地缓存中获取。

URL我的页面如下:

http://mywebsite.net/page1.aspx?v=2015_3.0&ln=en-EN&sid=612e0d3f-f29d-4b98-b4f7-6788e5a35a03

页面的响应 Header 如下所示:

Cache-Control:private, max-age=31536000
Content-Encoding:gzip
Content-Length:18355
Content-Type:text/html; charset=utf-8
Date:Thu, 03 Sep 2015 15:34:59 GMT
Expires:Fri, 02 Sep 2016 15:34:56 GMT
Last-Modified:Thu, 03 Sep 2015 15:34:56 GMT
Server:Microsoft-IIS/8.5
Vary:Accept-Encoding
X-AspNet-Version:4.0.30319
X-Powered-By:ASP.NET

在我的 aspx 代码中,这是我设置的

resp.Cache.SetCacheability(HttpCacheability.ServerAndPrivate)
resp.Cache.SetOmitVaryStar(True)
resp.Cache.SetExpires(DateTime.UtcNow.AddYears(1))
resp.Cache.SetMaxAge(New TimeSpan(365, 0, 0, 0))          
resp.Cache.SetLastModified(DateTime.UtcNow)            
resp.Cache.SetValidUntilExpires(True)
resp.Cache.VaryByParams.Item("v") = True
resp.Cache.VaryByParams.Item("ln") = True
resp.Cache.VaryByParams.Item("sid") = False

任何人都可以提出为什么浏览器不从本地缓存中获取页面吗?

这是因为查询字符串不断变化,因此浏览器忽略了缓存页面。