I will be populating DataTable
and other controls
from a complex object
.
- Where should I store such an
object
? - At what size does session variables starts affecting the performance of page?
I will be populating DataTable
and other controls
from a complex object
.
object
? 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...
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.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.