mirror of
https://github.com/bitwarden/server.git
synced 2025-07-13 13:47:30 -05:00
setting for disabling icons cache
This commit is contained in:
@ -49,7 +49,7 @@ namespace Bit.Icons.Controllers
|
||||
}
|
||||
|
||||
var mappedDomain = _domainMappingService.MapDomain(domain);
|
||||
if(!_memoryCache.TryGetValue(mappedDomain, out Icon icon))
|
||||
if(!_iconsSettings.CacheEnabled || !_memoryCache.TryGetValue(mappedDomain, out Icon icon))
|
||||
{
|
||||
var result = await _iconFetchingService.GetIconAsync(domain);
|
||||
if(result == null)
|
||||
@ -62,7 +62,7 @@ namespace Bit.Icons.Controllers
|
||||
}
|
||||
|
||||
// Only cache not found and smaller images (<= 50kb)
|
||||
if(icon == null || icon.Image.Length <= 50012)
|
||||
if(_iconsSettings.CacheEnabled && (icon == null || icon.Image.Length <= 50012))
|
||||
{
|
||||
_memoryCache.Set(mappedDomain, icon, new MemoryCacheEntryOptions
|
||||
{
|
||||
|
Reference in New Issue
Block a user