Skip to main content

Rule examples: DASH

MPEG-DASH delivers adaptive streaming through an XML manifest (.mpd) that references fragmented MP4 segments (.m4s). As with HLS, the manifest must stay fresh while segments can be cached a little longer. This page provides a template of cache rules and a CORS header rule tuned for DASH players such as dash.js.

Manifest vs. segment TTLs

A live .mpd is updated as the presentation advances, so it needs a very short TTL. The .m4s segments are immutable once published and can be cached longer to offload the origin.

File typePattern (case-insensitive regex)TTLWhy
Manifest (MPD)~* \.(mpd)$2 secondsMust stay fresh; the live presentation advances.
Media segment~* \.(m4s)$10 secondsImmutable within the rolling window.
tip

DASH and HLS share the same caching philosophy: short TTL on the manifest, modest TTL on the segments. If you serve both protocols from one property, use the combined manifest pattern below so a single rule covers .m3u8 and .mpd.

Manifest cache rule

In the property's Rules tab, click Add cache rule and set:

  • Pattern: \.(mpd)$Regex match type (case-insensitive)
  • TTL: 2 seconds
  • Order: 1

Segment cache rule

Add a second cache rule for the segments:

  • Pattern: \.(m4s)$Regex match type
  • TTL: 10 seconds
  • Order: 2
note

The .m4s segment extension is shared by HLS (with fragmented MP4 / CMAF) and DASH. A single segment rule with pattern \.(ts|m4s)$ therefore covers both protocols when you serve them side by side.

Serving HLS and DASH together

If one property delivers both protocols, collapse the two manifest rules into one — a single cache rule with Pattern \.(m3u8|mpd)$ (Regex) and TTL 2 keeps every playlist fresh.

This is exactly what Paradarum uses for the system manifest rule on managed live properties.

CORS header rule for dash.js

dash.js loads the manifest and segments over fetch/XHR, so the responses need a permissive CORS header. Add a response header rule:

  • Action: Set
  • Header name: Access-Control-Allow-Origin
  • Header value: *
  • Apply to: Response
  • Pattern: empty (all requests)
tip

Use a specific origin instead of * to restrict which sites may embed your dash.js player.

A note on Paradarum Live properties

When you publish via Paradarum Live, the backing CDN property already carries equivalent system rules: a combined ~* \.(m3u8|mpd)$ manifest rule (TTL 2s), a ~* \.(ts|m4s)$ segment rule (TTL 10s), and an Access-Control-Allow-Origin: * CORS rule. They are read-only on the managed property. Use the templates here only for custom DASH delivery on a standard property. See live playback and caching.

See also