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 type | Pattern (case-insensitive regex) | TTL | Why |
|---|---|---|---|
| Manifest (MPD) | ~* \.(mpd)$ | 2 seconds | Must stay fresh; the live presentation advances. |
| Media segment | ~* \.(m4s)$ | 10 seconds | Immutable within the rolling window. |
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:
2seconds - Order:
1
Segment cache rule
Add a second cache rule for the segments:
- Pattern:
\.(m4s)$— Regex match type - TTL:
10seconds - Order:
2
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)
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
- Rule examples: HLS — the equivalent rules for HLS playlists and segments.
- Live playback and caching — system rules on managed live properties.
- Cache rules and header rules — full references.