adds config and method to verify that a url exists (returns success s…#4
adds config and method to verify that a url exists (returns success s…#4
Conversation
…tatus code) when selecting provider
jemayn
left a comment
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
There is a setting for disabling it (https://github.com/skttl/ImageSharpCommunity.Providers.Remote/pull/4/files/eebcbca5a3b5cf3200aa732c6731e48e47d375ee#diff-12880d2b1b3960431556d39eb33890821d623cb973bfaf324a888b31e69206f0R63) its enabled by default :)
… response doesn't have one
…tatus code) when selecting provider