数据缓存VS在ASP.Net会话对象

数据缓存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.