为什么不将缓存(System.Web.Caching.Cache)用于状态管理? [英] Why isn't caching (System.Web.Caching.Cache) used for state management?

查看:245
本文介绍了为什么不将缓存(System.Web.Caching.Cache)用于状态管理?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试了解有关在PostBack之后在GridView中持久保存数据源的可接受答案./a>,因为我有类似的问题.

I'm trying to understand the accepted answer for Persisting DataSource in GridView after PostBack as I have a similar problem.

报价:

我避免不必要地将内容放入VeiwState或会话中,因此,我认为保留此数据的最佳方法是对其进行缓存.

I steer clear of putting stuff into the VeiwState or session unnecessarily, so I think the best way to persist this data is to Cache it.

当我查看状态管理的MS建议时:

When I look at the MS suggestions for state management: ASP.NET State Management Overview caching is no where to be seen. There is a comment (search for Jim_Huff), asking about this, but it isn't answered.

问题:

Question: What's the deal with cache in this context - should I use it or not?

推荐答案

该问题的答案由问题作者提供,并不是一个很好的答案.

The answer to that question was supplied by the question author, and it is not a very good answer.

状态管理用于管理单个会话的状态.有各种安全措施可以确保您不会践踏其他用户的会话状态,并且有完善的机制可以清除旧会话,放弃会话等.

State management is for managing the state of a single session. There are safeguards to ensure that you do not trample over other user's session state, and well-defined mechanisms for scavenging old sessions, abandoning sessions, etc.

应用程序缓存用于管理整个应用程序的全局状态.不适用于管理会话状态.

The application cache is for managing the global state of the entire application. It's not appropriate to use it for managing session state.

这篇关于为什么不将缓存(System.Web.Caching.Cache)用于状态管理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆