开发者

is it ok to store rather big amount of data in session?

I'm doing a survey builder, and I think to store the su开发者_运维问答rvey in session with a unique guid key until the user creates it fully and saves it

I'm thinking it is going to be an array of 100~200 objects (8 properties class)


That sounds like a fair use of Session.

Whether your data is too large depends on quite a few things, such as your web server's memory. The best thing to do is test the performance using Session. If you find your data is too heavy for Session have a look at ASP.NET Profile.


That doesn't sound like that much data unless we are talking about reams of text for each answer. I would not worry about it unless I was working on a web site expected to have thousands of these open at any given point in time.


IMHO I think the data should be stored in something other than the Session.
Session objects can disappear for a myriad of reasons. Would your users be annoyed if their answers are not persisted and needs to start afresh.

Remember to write the data to a persistent store (DB, files, etc) as soon as possible unless the users don't mind starting over.


I agree with ggonsalv. I would store the data somewhere just in case the session is lost. I have been to sites where I fill stuff out and then it looses it near the end. It's not fun to start over.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜