Updated ImageLoader

This commit is contained in:
ClemensFischer 2025-12-25 20:01:08 +01:00
parent 7cdbca9c8c
commit 3c991d691b
3 changed files with 36 additions and 31 deletions

View file

@ -201,12 +201,15 @@ namespace MapControl
if (buffer == null)
{
(buffer, var maxAge) = await ImageLoader.GetHttpResponseAsync(uri).ConfigureAwait(false);
using var response = await ImageLoader.GetHttpResponseAsync(uri).ConfigureAwait(false);
if (buffer != null)
if (response != null)
{
buffer = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
try
{
var maxAge = response.Headers.CacheControl?.MaxAge;
var options = new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow =