1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-17 02:01:53 +01:00

response caching for 24 hours

This commit is contained in:
Kyle Spearrin 2017-10-10 21:35:52 -04:00
parent 0cbd00e063
commit ac901716cf
2 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,7 @@ namespace Bit.Icons.Controllers
}
[HttpGet("")]
[ResponseCache(Duration = 86400 /*24 hours*/, VaryByQueryKeys = new string[] { "url" })]
public async Task<IActionResult> Get([FromQuery]string url)
{
if(string.IsNullOrWhiteSpace(url))

View File

@ -31,6 +31,7 @@ namespace Bit.Icons
{
options.SizeLimit = iconsSettings.CacheSizeLimit;
});
services.AddResponseCaching();
// Services
services.AddSingleton<IDomainMappingService, DomainMappingService>();
@ -46,6 +47,7 @@ namespace Bit.Icons
app.UseDeveloperExceptionPage();
}
app.UseResponseCaching();
app.UseMvc();
}
}