mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
Fixed: Cache headers for static resources
Towards #4356 (cherry picked from commit efd9fe9ad0f08aa55a59a3b8365d8bdd471ffa8b)
This commit is contained in:
parent
fe2af13fae
commit
5d5e66f0d7
@ -11,6 +11,7 @@ namespace Radarr.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");
|
||||
|
||||
@ -50,8 +51,8 @@ public static IDictionary<string, string> DisableCache(this IDictionary<string,
|
||||
|
||||
public static IDictionary<string, string> EnableCache(this IDictionary<string, string> 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";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user