- BypassCache => If this value is true, program will ignore this cache and will run the command.
- CacheKey => The string value to map the result. With this key, we can access the result whenever we want.
- SlidingExpiration => Time cost for the cache. After the given time pass, Redis will delete this result from memory.
- BypassCache => If this value is true, program will ignore this cache and will run the command.
- CacheKey => The string value to access the keys. With this key, remove the caches we want from the Redis memory. Whichever key has this value in the name, will be deleted from the memory.
public bool BypassCache => false;
public string CacheKey => $"{this.GetType().Name}&id={this.Id}";
public TimeSpan? SlidingExpiration => TimeSpan.FromMinutes(10);
public bool BypassCache => false;
public string CacheKey => $"{this.GetType().Name}&pagesize={this.PageRequest.Page}&page={this.PageRequest.PageSize}";
public TimeSpan? SlidingExpiration => TimeSpan.FromMinutes(20);
public bool BypassCache => true;
public string CacheKey => "City";