在ASP.net会话变量有没有限制? [英] Are there limits for session variables in ASP.net?

查看:105
本文介绍了在ASP.net会话变量有没有限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将填充数据表控制从复杂的对象


  1. 我应该在哪里存放这样的对象

  2. 在什么规模呢会话变量开始影响页面的性能?


解决方案

数据在会话对象存储在内存中的服务器上。从而存储限制是对服务器可用的存储器。这个数据没有在任何阶段发送到客户端,除非明确这样做。取而代之的是MVC code发送的cookie到客户端浏览器,一旦你已经分配到Session对象的任何值。然后该cookie的值用于唯一标识会话

所以...


  1. 会话对象是专门设计,让您可以存储在服务器上的特定会话的数据,因此是一个合适的地方让你放如特定会话的数据结构你描述。

  2. 因为会话对象是服务器端只使用会话来存储计算昂贵操作的结果不变的是跨多个页面刷新会加快页面加载,因为你可以使用previous结果,而不必重新创建的。除非你吹灭服务器上的内存限制,你不会看到任何性能下降。

I will be populating DataTable and other controls from a complex object.

  1. Where should I store such an object?
  2. At what size does session variables starts affecting the performance of page?

解决方案

Data in the Session object is stored in memory on the server. Thus the storage limit is the memory available to the server. This data is not sent to the client at any stage, unless you explicitly do so. Instead the MVC code sends a cookie to the client browser once you have assigned any value to the Session object. The value of this cookie is then used to uniquely identify the session.

So...

  1. The Session object is designed specifically so that you can store session-specific data on the server, so is a suitable place for you to put session-specific data structures like you describe.
  2. Because the Session object is server-side only, using Session to store the results of computationally expensive operation that is invariant across multiple page refreshes will speed up page loads, since you can use the previous result instead of having to create it again. Unless you blow out the memory limits on the server, you're not going to see any performance degradation.

这篇关于在ASP.net会话变量有没有限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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