From efd9fe9ad0f08aa55a59a3b8365d8bdd471ffa8b Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 7 Mar 2021 14:49:41 -0800 Subject: [PATCH] Fixed: Cache headers for static resources Towards #4356 --- src/Sonarr.Http/Extensions/ReqResExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Sonarr.Http/Extensions/ReqResExtensions.cs b/src/Sonarr.Http/Extensions/ReqResExtensions.cs index a8516899d..a567f6973 100644 --- a/src/Sonarr.Http/Extensions/ReqResExtensions.cs +++ b/src/Sonarr.Http/Extensions/ReqResExtensions.cs @@ -11,6 +11,7 @@ namespace Sonarr.Http.Extensions public static class ReqResExtensions { private static readonly NancyJsonSerializer NancySerializer = new NancyJsonSerializer(); + private static readonly string Expires = DateTime.UtcNow.AddYears(1).ToString("r"); public static readonly string LastModified = BuildInfo.BuildDateTime.ToString("r"); @@ -51,8 +52,8 @@ public static IDictionary DisableCache(this IDictionary EnableCache(this IDictionary headers) { - headers["Cache-Control"] = "max-age=31536000 , public"; - headers["Expires"] = "Sat, 29 Jun 2020 00:00:00 GMT"; + headers["Cache-Control"] = "max-age=31536000, public"; + headers["Expires"] = Expires; headers["Last-Modified"] = LastModified; headers["Age"] = "193266";