OvenMediaEngine Enterprise
English
English
  • About
    • Introduction
    • Release Notes
      • 0.19.0
      • 0.18.3
      • 0.18.2
      • 0.18.1
      • 0.18.0
      • 0.17.3
      • 0.17.2
      • 0.17.1
      • 0.17.0
      • 0.16.8
      • 0.16.7
      • 0.16.6
      • 0.16.5
      • 0.16.4
  • Pre-Built Package Installation
    • Getting Started
      • Getting Started with Ubuntu
      • Getting Started with RHEL
      • Getting Started with Docker
    • Configuration Structure Overview
  • Advanced Security
    • Digital Rights Management (DRM)
      • OvenMediaEngine Configuration for DRM
      • PallyCon DRM Configuration
    • RTMP Authentication
  • SHA-2 Support
  • High Availability
    • Origin Redundancy
  • Web Console
    • Getting Started with Web Console
    • Web Console Overview
      • Sign In
      • Change Password
      • Web Console Home
      • Stream List
        • Managed and Instant Streams
        • Scheduled Channels
        • Multiplex Channels
      • Event Monitoring
        • Configuration
        • Event Specification
      • Web Console Publishing
      • Logs
      • Configuration Files
      • Restart
    • Web Console Settings
      • Server Settings
      • Live Sources (Ingress) Settings
      • ABR and Transcoding Settings
      • Streaming (Egress) Settings
      • TLS Encryption Settings
      • Access Control Settings
      • Thumbnail Settings
      • Recording Settings
      • Push Publishing Settings
      • REST API Settings
      • Alert Settings
  • Operations & Monitoring
    • API Storage
    • Recording Delivery
  • Performance Optimization
    • Hardware Encoder Support
  • Workflow Integration & External System Connectivity
    • CDN Cache Control
    • Proxy Protocol
    • SEI Insertion
    • AMF0 Message Insertion
    • HLS Markers (CUE-OUT/IN)
    • onCuePoint Message Insertion
    • Delay Buffer
    • Query String Handling
    • Default Playlist Creation
    • iOS Audio PTS
  • REST API
    • v2
      • Statistics
        • Current
Powered by GitBook
On this page
  1. Workflow Integration & External System Connectivity

CDN Cache Control

PreviousHardware Encoder SupportNextProxy Protocol

Last updated 2 months ago

CtrlK
  • Control Origin Cache
  • Cache Validation

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:

<?xml version="1.0" encoding="UTF-8"?>
<Server version="8">
  ...
  <VirtualHosts>
    <VirtualHost>
      <Applications>
        <Application>
          <Publishers>
            ...
            <LLHLS>
              <OriginMode>true</OriginMode>
              <CacheControl>
                <MasterPlaylistMaxAge>0</MasterPlaylistMaxAge>
                <ChunklistMaxAge>0</ChunklistMaxAge>
                <ChunklistWithDirectivesMaxAge>60</ChunklistWithDirectivesMaxAge>
                <SegmentMaxAge>-1</SegmentMaxAge>
                <PartialSegmentMaxAge>-1</PartialSegmentMaxAge>
              </CacheControl>
            </LLHLS>
          </Publishers>
        </Application>
      </Applications>
    </VirtualHost>
  </VirtualHosts>
</Server>
Element
Description

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

Specifies the max-age of the Media Playlist with the . The currently supported Delivery Directives are _HLS_msn and _HLS_part. It is a Playlist with Segment numbers and Partial Segment numbers, and this URL 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.

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

Element
Description

0

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.

Cache Validation

Enabling this feature allows identification of whether the cached resource version matches the resource in OvenMediaEngine. When the HTTP request includes the If-None-Match: "<etag_value>" header, it compares the resource Etag with the OvenMediaEngine's resource Etag, and if the values match, it returns 304 Not-Modified.

Set the <Modules><ETag> in Server.xml like this:

<Server>
  <Modules>
    <ETag>
      <Enable>true</Enable>
    </ETag>
  </Modules>
</Server>

When enabled, an Etag header will be added to all HTTP responses.

Low-Latency HLS Delivery Directives