Groups | Blog | Home
all groups > asp.net webservices > march 2008 >

asp.net webservices : Caching App Data


Dave T
3/12/2008 12:51:00 PM
The data for my web app is an object model that consists of a class with a
series of properties typed as generic.list(of SomeClass). The object model
gets built up along the way by calls to SQL Server. Some of the data is
global data, some of it is user data. Instead of making multiple calls to
the DB to get the same data, I was thinking that I could cache the object
model and retrieve it.

To do that in .net 1.1, I would have done something like this

Dim _GobalData as new GlobalDataObjectModel
_GobalData = Cache("GlobalData")
If _GlobalData Is Nothing Then
_GlobalData = CreateGlobalData
Cache("GlobalData") = _GlobalData
End IF
UseGlobalData()

It seems caching in .net 2.0 is quite different. For one thing, there seems
to be a problem with my reference to *cache*. Is it possible to do this? If
Peter Bromberg [C# MVP]
3/12/2008 1:11:29 PM
The namespace is System.Web.Cache. If you are having trouble, try
HttpContext.Current.Cache.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net


[quoted text, click to view]
AddThis Social Bookmark Button