From 97d2dc4b232d3ad28b74a00bb3af37fb212e48ad Mon Sep 17 00:00:00 2001 From: Vince Pergolizzi Date: Mon, 19 Apr 2021 19:11:47 -0400 Subject: [PATCH] remove stale 0 default --- src/CacheTower/CacheSettings.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/CacheTower/CacheSettings.cs b/src/CacheTower/CacheSettings.cs index eafa38b2..1a61b7fa 100644 --- a/src/CacheTower/CacheSettings.cs +++ b/src/CacheTower/CacheSettings.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace CacheTower { @@ -21,10 +19,6 @@ public struct CacheSettings /// /// Configures the cache entry to have a life of . /// - /// - /// As no stale time has been configured, the cache entry is always considered stale and will always perform a background refresh. - /// In most cases it is recommended to use and set an appropriate stale after time. - /// /// /// How long till a cache entry is considered expired. /// Expired entries are removed from the cache and will force a foreground refresh if there is a cache miss. @@ -32,7 +26,7 @@ public struct CacheSettings public CacheSettings(TimeSpan timeToLive) { TimeToLive = timeToLive; - StaleAfter = TimeSpan.Zero; + StaleAfter = timeToLive; } /// @@ -48,7 +42,7 @@ public CacheSettings(TimeSpan timeToLive) /// /// Setting this too low will cause potentially unnecessary background refreshes. /// Setting this too high may limit the usefulness of a stale time. - /// You will need to decide on the appropraite value based on your own usage. + /// You will need to decide on the appropriate value based on your own usage. /// /// public CacheSettings(TimeSpan timeToLive, TimeSpan staleAfter)