数据缓存VS在ASP.Net会话对象 [英] Data cache vs session object in ASP.Net

查看:125
本文介绍了数据缓存VS在ASP.Net会话对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应该为站点动态业务对象被存储在用户会话或使用ASP.Net缓存(对象,如定单,简档信息等)?

Should dynamic business objects for a site be stored in the users session or use ASP.Net caching (objects such as orders, profile information etc)?

我已经与使用的会话存储业务对象网站合作,但我想知道......有什么优势或缓存的缺点是什么?

I have worked with sites that used sessions to store business objects, but I was wondering...What are the advantages or disadvantages of caching?

推荐答案

如果对象是在用户会话之间共享,然后使用缓存。如果对象是唯一的每个环节 - 也许是因为他们是由管辖权限 - 那么它存储在会话。在进程内会话本身存储在缓存中这样的决定因素确实应该是数据的范围。

If the objects are shareable between user sessions, then use the cache. If the objects are unique to each session -- perhaps because they are governed by permissions -- then store it in the session. The in-process session itself is stored in the cache so the deciding factor really should be the scope of the data.

这篇关于数据缓存VS在ASP.Net会话对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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