Manage Azure CDN caching policy in Azure Media Services
Important
Azure CDN Standard from Microsoft (classic) will be retired on September 30, 2027. To avoid any service disruption, it is important that you migrate your Azure CDN Standard from Microsoft (classic) profiles to Azure Front Door Standard or Premium tier by September 30, 2027. For more information, see Azure CDN Standard from Microsoft (classic) retirement.
Azure Media Services provides HTTP based Adaptive Streaming and progressive download. HTTP based streaming is highly scalable with benefits of caching in proxy and CDN layers and client-side caching. Streaming endpoints provides general streaming capabilities and also configuration for HTTP cache headers. Streaming endpoints sets HTTP Cache-Control: max-age and Expires headers. You can get more information for HTTP cache headers from W3.org.
Default Caching headers
By default streaming-endpoints apply three day cache headers for on-demand streaming data (actual media fragments/chunks) and manifest(playlist). For live streaming, streaming endpoints apply three day cache headers for data (actual media fragments/chunks) and 2-seconds cache header for manifest(playlist) requests. When live program turns to on-demand (live archive), then on-demand streaming cache headers apply.
Azure CDN integration
Azure Media Services provides integrated CDN for streaming-endpoints. Cache-control headers apply in the same way as streaming endpoints to CDN enabled streaming endpoints. Azure CDN uses streaming endpoint configured cache values to define the life time of the internally cached objects and also uses this value to set the delivery cache headers. When using CDN enabled streaming endpoints, it isn't recommended to set small cache values. Setting small values decrease the performance and reduce the benefit of CDN. It isn't allowed to set cache headers smaller than 600 seconds for CDN enabled streaming endpoints.
Important
Azure Media Services has complete integration with Azure Content Delivery Network. With a single click, you can integrate all the available Azure Content Delivery Network providers to your streaming endpoint including standard and premium products. For more information, see this announcement.
Data charges from streaming endpoint to CDN only gets disabled if the CDN is enabled over streaming endpoint APIs or using Azure portal's streaming endpoint section. Manual integration or directly creating a CDN endpoint using CDN APIs or portal section doesn't disable the data charges.
Configuring cache headers with Azure Media Services
You can use Azure portal or Azure Media Services APIs to configure cache header values.
- To configure cache headers using Azure portal, refer to How to Manage Streaming Endpoints section Configuring the Streaming Endpoint.
- Azure Media Services REST API, StreamingEndpoint.
- Azure Media Services .NET SDK, StreamingEndpointCacheControl Properties.
Cache configuration precedence order
- Azure Media Services configured cache value overrides default value.
- If there's no manual configuration, default values apply.
- By default 2-seconds cache headers apply to live streaming manifest(playlist) regardless of Azure Media or Azure Storage configuration and overriding of this value isn't available.