Origin Cache Control
Control Origin Cache
You can specify how long content should be cached on edge servers or CDN cache servers by adding a Cache-Control
header to the HTTP response.
Set the <Publishers><LLHLS><CacheControl>
in Server.xml
like this:
MasterPlaylistMaxAge
Specifies the max-age of the Master Playlist. It will not change while the Stream is being created.
ChunklistMaxAge
Specifies the max-age of the Media Playlist. It must always respond with the latest Media Playlist and is a URL without Delivery Directives for LL-HLS. Therefore, it should be cached as short as possible or not at all.
ChunklistWithDirectivesMaxAge
SegmentMaxAge
Specifies the max-age of the Segment File. The URL of the Segment File is unique while the Stream is being created and can be cached for a long time because the content of the same URL does not change.
PartialSegmentMaxAge
Specifies the max-age of the Partial Segment File. The URL of the Partial Segment File is unique while the Stream is being created and can be cached for a long time because the content of the same URL does not change.
<CacheControl>
Elements
<CacheControl>
Elements0
CacheControl: no-cache, no-store
Instructs not to cache the content at all, always fetching new data from the Server.
Greater than 0
CacheControl: max-age=<seconds>
Specifies the duration for which the Cache remains valid.
-1
Without CacheControl
header
Indicates that no specific Cache Header will be sent from the Origin. In this case, caching may not be used at all, or the CDN or Cache server's policies may be applied, or the default Cache behavior of the Client or Browser may be followed.
<CacheControl>
can be used with 0 and positive values, while using -1 may result in unexpected caching behaviors, so caution is advised.