I have referred the below doc to implement user session based caching, i can see the caching is working fine, but i need clarity on what is the purpose of the file when we dont have any logic to store anything on it. If i want to customize the code by myself what is expected to be saved in the text file?
private static readonly string _cacheBreakerPath = @"C:\Skyline DataMiner\Documents\Ad hoc cache\resultsCacheBreaker.txt";
private void CheckCacheValidation() {
if (!File.Exists(_cacheBreakerPath)) return;
lock (_groupToCache) {
try { _
logger.Information("Going to remove cache.");
if (!File.Exists(_cacheBreakerPath)) return;_groupToCache.Clear();
File.Delete(_cacheBreakerPath);
_logger.Information("Remove cache.");
}
catch (Exception ex) {
_logger.Error(ex, "Could not delete cache."); } } }
Kindly check the below link for full source code example.