I have a Telerik Menu in usercontrol that located in aspx page, I need to generate menu based on logged in user.
So I need to bind datasource to the menu.
My web site gonna have more than 1000 users per day.
For preventing round trip requests, I generate the menu from session.
I use InProc session for that purpose and I keep the Sql Data in session.
The session object size for menu is about 40 bytes. So (1000 users) * (40 bytes ) =about 40K server’s memory.
I don’t have any other server for using StateServer Session.
And also I am going to use session for some other purposes too.
Is there any better solution for that cause the performance plays a key role for my scenario.
Or already I’ve chosen the best solution ?
It doesn’t sound like you should have any problem doing it this way, but you may be interested in my answer to this question.
Generally speaking, the session is a good place to cache data which:
It sounds like you match at least the first two requirements above.
One project I worked on had a need similar to the one you’re describing, but many users would end up with the exact same menu, and the generation of the menu itself was expensive, so I divided the problem into pieces, like this:
These two repositories used a sliding memory cache, so that in most cases both the menu key and the menu itself would already be constructed. If a new user logs in, but is supposed to see the same menu items as some other recent user, the first repository needs to construct their menu key, but the actual menu is already cached.
I don’t know if this approach would make sense for you, but there it is, for what it’s worth.