使用 Substitution 控件时忽略 Asp.Net OutputCache 指令
我有一个显示登录用户名的主页。内容页 (default.aspx) 使用此母版并具有 OutputCache 指令。
缓存按照宣传的方式工作,除了当我将替换控件添加到母版页时,所有缓存都会停止,每次刷新都会得到一个新页面。 Substitution 控件将正确的用户名插入到页面中,因此它被调用。但其中的某些东西似乎正在杀死缓存。返回用户名的代码只是返回一个固定字符串,而我正在测试以确保没有副作用。
如果我不使用替换控件,页面会被缓存,但对所有用户显示的用户名也会被缓存)。
是否支持此场景(母版页未缓存,母版页上的替换控制,内容页已缓存)?
有任何故障排除提示可以了解是什么使缓存无效吗?
I have a master page that shows the logged in user name. The content page (default.aspx) uses this master and has an OutputCache directive.
The cache works as advertised except for when I add the Substitution control to the master page at which point, all caching stops and I get a fresh page each refresh. The Substitution control inserts the correct username into the page, so it is getting called. But something in there seems to be killing off the cache. The code for returning the user name simply returns a fixed string while I am testing to ensure no side effects.
If I don't use the substitution control the page gets cached, but so does the username which is shown the same to all users).
Is this scenario supported (master page is not cached, Substitution control on master,content page is cached)?
Any troubleshooting hints to see what is invalidating the cache?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论