using Microsoft.AspNetCore.Mvc; namespace RadicadeServer.CDN { internal static class CdnCaching { public const string Immutable = "public, max-age=31536000, immutable"; public const string Replaceable = "public, max-age=86400"; public static string ForBlob(string name) => name.EndsWith(".assetbundle", StringComparison.OrdinalIgnoreCase) ? Immutable : Replaceable; public static void Apply(Controller controller, string cacheControl) { if (controller.ControllerContext?.HttpContext == null) return; controller.Response.Headers["Cache-Control"] = cacheControl; } } }