tiels are cached and reused properly

This commit is contained in:
Anton Martynenko
2025-10-29 11:57:50 +01:00
parent 72eea71507
commit caa30e5017
15 changed files with 509 additions and 57 deletions
@@ -84,40 +84,6 @@ public class GoogleMapsDownloaderV2
var response = await httpClient.GetAsync(url, token);
response.EnsureSuccessStatusCode();
_logger.LogInformation("=== HTTP Response Headers from Google Maps ===");
_logger.LogInformation("Status Code: {StatusCode}", response.StatusCode);
foreach (var header in response.Headers)
{
_logger.LogInformation("Header: {Key} = {Value}", header.Key, string.Join(", ", header.Value));
}
foreach (var header in response.Content.Headers)
{
_logger.LogInformation("Content Header: {Key} = {Value}", header.Key, string.Join(", ", header.Value));
}
if (response.Headers.ETag != null)
{
_logger.LogInformation("*** ETag Found: {ETag}", response.Headers.ETag.Tag);
}
if (response.Content.Headers.LastModified.HasValue)
{
_logger.LogInformation("*** Last-Modified Found: {LastModified}", response.Content.Headers.LastModified.Value);
}
if (response.Headers.CacheControl != null)
{
_logger.LogInformation("*** Cache-Control: MaxAge={MaxAge}, Public={Public}, Private={Private}, MustRevalidate={MustRevalidate}",
response.Headers.CacheControl.MaxAge,
response.Headers.CacheControl.Public,
response.Headers.CacheControl.Private,
response.Headers.CacheControl.MustRevalidate);
}
_logger.LogInformation("=== End of Headers ===");
var imageBytes = await response.Content.ReadAsByteArrayAsync(token);
await File.WriteAllBytesAsync(filePath, imageBytes, token);