Adds variation by the header name Accept-Language to the delivery API output cache policy (#19709)

* Adds variation by the header name Accept-Language to the develivery API output cache policy

* Removed obsolete constructor (not necessary as the class is internal).

* Introduce contants for header names.
This commit is contained in:
Andy Butland
2025-07-11 15:51:05 +02:00
parent 543b644ed1
commit 4deb756e64
9 changed files with 67 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
namespace Umbraco.Cms.Core;
namespace Umbraco.Cms.Core;
public static partial class Constants
{
@@ -24,14 +24,45 @@ public static partial class Constants
public static class OutputCache
{
/// <summary>
/// Output cache policy name for content
/// Output cache policy name for content.
/// </summary>
public const string ContentCachePolicy = "DeliveryApiContent";
/// <summary>
/// Output cache policy name for media
/// Output cache policy name for media.
/// </summary>
public const string MediaCachePolicy = "DeliveryApiMedia";
}
/// <summary>
/// Constants for Delivery API header names.
/// </summary>
public static class HeaderNames
{
/// <summary>
/// Header name for accept language.
/// </summary>
public const string AcceptLanguage = "Accept-Language";
/// <summary>
/// Header name for accept segment.
/// </summary>
public const string AcceptSegment = "Accept-Segment";
/// <summary>
/// Header name for API key.
/// </summary>
public const string ApiKey = "Api-Key";
/// <summary>
/// Header name for preview.
/// </summary>
public const string Preview = "Preview";
/// <summary>
/// Header name for start item.
/// </summary>
public const string StartItem = "Start-Item";
}
}
}