diff --git a/src/Icons/Controllers/IconsController.cs b/src/Icons/Controllers/IconsController.cs index a632bfb3fc..c17d174ce7 100644 --- a/src/Icons/Controllers/IconsController.cs +++ b/src/Icons/Controllers/IconsController.cs @@ -27,6 +27,7 @@ namespace Bit.Icons.Controllers } [HttpGet("")] + [ResponseCache(Duration = 86400 /*24 hours*/, VaryByQueryKeys = new string[] { "url" })] public async Task Get([FromQuery]string url) { if(string.IsNullOrWhiteSpace(url)) diff --git a/src/Icons/Startup.cs b/src/Icons/Startup.cs index 64f921d232..2c9e365c1d 100644 --- a/src/Icons/Startup.cs +++ b/src/Icons/Startup.cs @@ -31,6 +31,7 @@ namespace Bit.Icons { options.SizeLimit = iconsSettings.CacheSizeLimit; }); + services.AddResponseCaching(); // Services services.AddSingleton(); @@ -46,6 +47,7 @@ namespace Bit.Icons app.UseDeveloperExceptionPage(); } + app.UseResponseCaching(); app.UseMvc(); } }