Since I have no errors I don’t know if this is the right place to ask this question, if it’s not, please point me to the right forum. Any way…
I am working on a social network project and now it runs really slow, some pages take like 5 to 15 seconds to load. There is a “cache” structure but whoever did this, didn’t use to already build in Cache from the c# .net, instead, they created a static List<object> as the cache of the system. Even tought is not right, i can deal with that…
The problem is, on every page request, I have to load the user data from this cache wich is quite big, and the user structure is quite big as well so I was wondering, stead of loading the user data from cache everytime a page is requested I will create Some sessions with the most used data that every page requires, like, photo, name, nickname, id, and than when I need to load anyother type of data from user that is not common, I request it from the cache…
I don’t know if this is the right aproach not if this is the right place to ask it, but I really need to solve this problem pretty bad. so I would like some advices from the experts out here.
Part of the performance problem may be needing to scan the cache for items. A Dictionary might be better, since you could retrieve items by key. This is a closer implementation to the native cache structure.
Sessions are bad for scalability of a website. If you plan on this being as big as facebook or something, using sessions for caching will kill you
See this other related question :
What is a good way to store large temporary "session" data in a web application
and another decent question
Why is it a bad idea to use Session to store state in high traffic websites?