server caching

  • Thread starter Thread starter Jo Versmissen
  • Start date Start date
J

Jo Versmissen

Does anyone know how a component can be cached server side. I know how to
cache a component and it works, but I think this is client side caching,
because it works with the current HttpContext.

....
Cache cache = HttpContext.Current.Cache;
Table table;
// Get the table from the cache
table = (Table) cache.Get("myCacheKey");

// If nothing is found, create the table and insert it in the cache
if (table == null)
{
table = new Table();
SetTable; // This function creates the table
cache.Insert("myCacheKey", table, null, DateTime.Now.AddMinutes(5),
TimeSpan.Zero);
}
....
 
Hi Jo:

HttpContext.Current.Cache is a server side cache. HttpContext
represents various properties about the state of the current request
as it executes on the server.
 
Thanks Scott.

So this means that all the users get their info from the same cache.

Greetings,
Jo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top