@{
var cacheItemKey = "CachedTime";
var cacheHit = true;
var time = WebCache.Get(cacheItemKey);
if (time == null) {
cacheHit = false;
}
if (cacheHit == false) {
time = @DateTime.Now;
WebCache.Set(cacheItemKey, time, 1, false);
}
}
WebCache Helper Sample
@if (cacheHit) {
@:Found the time data in the cache.
} else {
@:Did not find the time data in the cache.
}