Skip to content

Conversation

@skttl
Copy link
Owner

@skttl skttl commented Jan 22, 2025

…tatus code) when selecting provider

Copy link

@jemayn jemayn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One little comment in the files, other than that:

As this will add additional requests even though the response is cached I wonder if performing this check should be based on a setting?


if (response.Headers.CacheControl?.MaxAge is not null)
{
_cache.Set(nameof(RemoteImageProvider) + uri, response.IsSuccessStatusCode, response.Headers.CacheControl.MaxAge ?? TimeSpan.Zero);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the fallback value should be higher than TimeSpan.Zero, we would expect the header to always exist, but if it doesn't for some reason then setting the fallback cache expiration should maybe be an hour or something just to avoid more spamming?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skttl skttl merged commit de01fd0 into main Mar 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants