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);
}
....
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);
}
....