Large object in Silverlight / ASP.NET / WCF project?
I have to deal with a class that takes about 2-3 minutes to load. This object is on the server side of a silverlight / ASP / WCF project. Once loaded, this object will contain a list of 5 000 000 smaller object that will be used to perform some calculatio开发者_运维技巧n.
Users doesn't mind waiting 2 or 3 minutes when the application is loading but they don't want to wait again each time they calculate something.
I would like your input about my options.
Option A: Keep the large object in a session variable. Some people claims that session variable are poison... especially when used with large object. Is it really that bad?
Option B: Load the large object when the server start, then find a way to shared or duplicate this object between sessions
Option C (This one would work... but it's not perfect): Create a second object that will copy the 5 000 000 object from my time consuming class then send it to the client side. However, this solution is not perfect because those 5 000 000 objects are sensible data that should not be accessible "as is" on the client side.
you give out three methods, the first and second method ,use the seesion , i think they are not the good ideas.
i suggest, if you have the big memory ,you can change the class to static class. because the static class not instance it.
or you can use the cache to cache the instance.
精彩评论