1
0
mirror of https://github.com/bitwarden/server.git synced 2025-05-24 21:11:04 -05: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("")] [HttpGet("")]
[ResponseCache(Duration = 86400 /*24 hours*/, VaryByQueryKeys = new string[] { "url" })]
public async Task<IActionResult> Get([FromQuery]string url) public async Task<IActionResult> Get([FromQuery]string url)
{ {
if(string.IsNullOrWhiteSpace(url)) if(string.IsNullOrWhiteSpace(url))

View File

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