1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Changed cache expiry to be long

This commit is contained in:
Uncled1023 2018-06-20 23:54:05 -07:00
parent 7fda3e3269
commit 39d875e4cf
2 changed files with 3 additions and 4 deletions

View File

@ -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);

View File

@ -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;
}
});