mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update TileImageLoader.cs
This commit is contained in:
parent
3c5f2b30d8
commit
085a9b6181
|
|
@ -43,6 +43,12 @@ namespace MapControl
|
|||
/// </summary>
|
||||
public static TimeSpan DefaultCacheExpiration { get; set; } = TimeSpan.FromDays(1);
|
||||
|
||||
/// <summary>
|
||||
/// Minimum expiration time for cached tile images. A transmitted expiration time
|
||||
/// that falls below this value is ignored. The default value is TimeSpan.Zero.
|
||||
/// </summary>
|
||||
public static TimeSpan MinCacheExpiration { get; set; } = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum expiration time for cached tile images. A transmitted expiration time
|
||||
/// that exceeds this value is ignored. The default value is ten days.
|
||||
|
|
@ -170,6 +176,7 @@ namespace MapControl
|
|||
try
|
||||
{
|
||||
var expiration = !response.MaxAge.HasValue ? DefaultCacheExpiration
|
||||
: response.MaxAge.Value < MinCacheExpiration ? MinCacheExpiration
|
||||
: response.MaxAge.Value > MaxCacheExpiration ? MaxCacheExpiration
|
||||
: response.MaxAge.Value;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue