Thursday 13 January 2011

Cached Lists of Data

If you have lots of lists of data that are frequently referenced throughout your application and rarely change EG Langauages, Countries, Cities etc. it can be a good idea to add/retrieve them from the Cache.

Try:

HttpRuntime.Cache[key] = ArrayList{"Country1", ..., "CountryN"};


Not sure if thats how you instaniate an ArrayList (probably isn't) but you get the idea...(i hope)

Then retrieve like:

dropDownListData = (ArrayList)HttpRuntime.Cache[key];

No comments:

Post a Comment