Large Session vs multiple queries? C#

129 Views Asked by At

Should I have a large session variable or query the database multiple times? If a user comes to the site, it is almost sure that the user will access the object at least two times, if not more. As such, Should I put this object in a session variable or make multiple queries to the database? The data gets updated once everyday.

Or is there a better solution altogether?

1

There are 1 best solutions below

0
On

I'd use session variables just to store a couple of particular parameters from the user, not to store DB data. The DB Cache approach seems to be the best option, but make sure it works fine when many users are trying to hit it.