强制aspx页面重新缓存,如果是新的 [英] Force aspx page to re-cache if new
问题描述
我想知道这是否可行但是:有没有办法强制页面在服务器上更新时重新缓存?
这只发生在每两个飞蛾左右。当我对其中一个网页进行细微更改时,客户端浏览器通常会显示旧版本的页面,直到它们强制重新缓存。理想的解决方案是包含某种版本或修改日期,我可以用来有条件地强制页面重新缓存(如果可以自动完成,甚至更好)
如果无法做到这一点,设置no-cache会出现什么问题?对于我非常简单的网页,我是否会对加载时间产生严重影响?无论如何,大多数加载时间都基于页面的数据内容。
我在IIS 6上使用ASPX .NET 3.5,但所有这些都将很快更新,因此它不是一个限制因素(任何借口都可以提前升级比以后好了)。
提前谢谢^ _ ^
Hi,
I was wondering if this is even possible but: Is there a way to force a page to re-cache when it is updated on the server?
This only happens every couple of moths or so. When I make a subtle change to one of our web pages, the clients browser often shows the old version of the page until they force a re-cache. The ideal solution would be to include some sort of version or modified date that I could use to conditionally force the page to re-cache (or even better if this can be done automatically)
If this is not possible, what is the issue with setting no-cache? Would I expect severe impact to load times for my pretty simple web pages? Most of the loading times are based of the data content of the pages, anyway.
I am using ASPX .NET 3.5 on IIS 6 but all of this will be updated soon, so it isn't a limiting factor (any excuse to upgrade sooner rather than later is great).
Thanks in advance ^_^
推荐答案
只是一个建议不确定如果它是您正在寻找的,但为什么不在缓存上设置超时,以便它在x时间后过期,然后当用户回来时重新加载?
Cache.Insert(Session(CompId)&Name,Data,Nothing,System.Web.Caching.Cache.NoAbsoluteExpiration,TimeSpan.FromMinutes(30))
Just a suggestion not sure if its what your looking for but why don't you put a timeout on the cache so that it expires after x amount of time and then when the user comes back it is reloaded?
Cache.Insert(Session("CompId") & "Name", "Data", Nothing, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromMinutes(30))
这篇关于强制aspx页面重新缓存,如果是新的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!