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:
parent
0cbd00e063
commit
ac901716cf
@ -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))
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user