From 39d875e4cf1b47b08623356c6a2318e38d799fa5 Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Wed, 20 Jun 2018 23:54:05 -0700 Subject: [PATCH] Changed cache expiry to be long --- Teknik/Controllers/DefaultController.cs | 4 ++-- Teknik/Startup.cs | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Teknik/Controllers/DefaultController.cs b/Teknik/Controllers/DefaultController.cs index e1970b1..4c017eb 100644 --- a/Teknik/Controllers/DefaultController.cs +++ b/Teknik/Controllers/DefaultController.cs @@ -56,7 +56,7 @@ namespace Teknik.Controllers // Get the Favicon [HttpGet] [AllowAnonymous] - [ResponseCache(Duration = 60 * 60 * 24, Location = ResponseCacheLocation.Any)] + [ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)] public IActionResult Favicon([FromServices] IHostingEnvironment env) { string imageFile = FileHelper.MapPath(env, Constants.FAVICON_PATH); @@ -67,7 +67,7 @@ namespace Teknik.Controllers // Get the Logo [HttpGet] [AllowAnonymous] - [ResponseCache(Duration = 60 * 60 * 24, Location = ResponseCacheLocation.Any)] + [ResponseCache(Duration = 31536000, Location = ResponseCacheLocation.Any)] public IActionResult Logo([FromServices] IHostingEnvironment env) { string imageFile = FileHelper.MapPath(env, Constants.LOGO_PATH); diff --git a/Teknik/Startup.cs b/Teknik/Startup.cs index b217cd3..6708a16 100644 --- a/Teknik/Startup.cs +++ b/Teknik/Startup.cs @@ -172,8 +172,7 @@ namespace Teknik { OnPrepareResponse = ctx => { - const int durationInSeconds = 60 * 60 * 24; - ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public,max-age=" + durationInSeconds; + ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public,max-age=" + 31536000; } });