private bool IsExpired <T>(CacheData <T> data) { return(data == null || DateTime.Now > data.CreatedAt.AddMinutes(data.TtlMinutes)); }
private void Store <TK, TV>(TK key, TV value, long ttlMins = 24 * 60 * 7 * 4) // A month { CacheData <TV> data = new CacheData <TV>(ttlMins, value); File.WriteAllText(GetPath(key.ToString()), JsonConvert.SerializeObject(data)); }