这对缓存或会话很有用 [英] which is useful Cache or Session

查看:86
本文介绍了这对缓存或会话很有用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用母版页,其中的菜单会根据用户在代码中的滚动动态生成.同一菜单用于所有应用程序的特定用户注销.因此,与其重新创建,我需要为所有应用程序提供相同的菜单.字符串生成器中的菜单,它的大小很大.在我的情况下,会话或数据缓存会更好,并且消耗的内存更少,为什么?
我想提高母版页的性能.

谢谢

Hi,

I am using master page in which menu is generating dynamically according to user roll in code. same menu is using for all application to particular user up to log out. So instead of recreating i need same menu for all application. Menu in string builder which is very large size. session or data cache is better and less memory consuming in my situation and why?
I want to improve performance of master page.

Thanks

推荐答案

您好..

两者都是有用的.完全取决于您的要求.会话用于跟踪用户信息,而缓存可能无法实现..您甚至可以在会话中将数据库存储在会话中..
只需访问此链接 [
Hi there..

Both are useful. It depends upon your requirement that what you require exactly. Session is used to track the user information which is probably impossible with cache.. You can store even the database also in your session whenever it requires..
Just visit this link[^] to clear your doubts..

All the best..


使用Cache(在您的问题中,您说过要在应用程序中显示相同的菜单).登录后,将数据(基于用户角色)存储在Cache&中.用于菜单.
ASP.NET缓存依赖项 [
Use Cache(In your question you said you want to show the same menu in your application). After login store the data(based on user role) in Cache & use it for menu.
ASP.NET Caching Dependencies[^]


这篇关于这对缓存或会话很有用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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