I look for a configuration for clear cache each day at midnight.
It is possible ?
Or I need create a schedule task and clear in a code ?
I look for a configuration for clear cache each day at midnight.
It is possible ?
Or I need create a schedule task and clear in a code ?
// My cache, handle it the way you like
private static DataCache _cache;
public static void ClearCache()
{
Parallel.ForEach(_cache.GetSystemRegions(), region =>
{
_cache.ClearRegion(region);
var sysRegion = _cache.GetSystemRegionName(region);
_cache.ClearRegion(sysRegion);
});
}
Then run this at some schedule which you define yourself, somewhere.
I suppose the equivalent is fully possible to do in Powershell too, but this is a solution I've been using for a while.