Search code examples
asp.netweb-applicationssessionmultilingualapplication-variables

Is storing List of 1000+ instance of my custom class in session a memory problem?


Is storing a list of 1000 instance of my custom class to the session variable a good approach ? My asp.net web app need multilingual support and i am storing the labels in a table.I will have multiple users who has their own language preference and text(label content) preference.

I am thinking about loading the labels and store it in session variable and access that to use in the pages.Storing it in Application variable does not work because each customer have their own text for the labels.So is storing session a good way of doing this ? I guess i will have almost 1000 labels as of now and it may increase as the application grows.

My custom class has 2 proprties. LanguageCode and LanguageName

for some reason i cant use asp.net Resource files :(

Whats your thoughts on this ?


Solution

  • You should store a single set of labels for each language, then store the language name in session and use it to look up the correct labelset.