Cache Optimization

Last update:2026-10-19 14:31:46

Cache Optimization controls CDN edge caching for HTTP segmented delivery, such as HLS and DASH, and query string handling in cache keys and origin requests.

Note: Cache Optimization is available only for delivery domains configured with origin-pull.

Configure cache rules

Cache rules define how long CDN edge servers cache matching resources. Rules are evaluated by priority; a higher priority value is matched first.

Add a cache rule

  1. Go to Configuration, select the target domain, and open the Cache Optimization settings.
  2. In Cache Rules, choose Add.
  3. In the Cache Rules dialog, configure the following fields.
Field Required Description
Rule Scope Yes Select the resource scope: Specific File Type, Specific Directory, or URL Regular Expression.
Cache TTL Yes Enter the cache duration and select the time unit.
Priority Yes Set the match priority. A higher value has higher priority. Default: 10.
  1. Choose Confirm.

After the rule is added, it appears in the Cache Rules list with its scope, cache TTL, and priority.

Choose the right scope

Select a Rule Scope option based on the resources you want the rule to match:

Option Use case Input rule Example
Specific File Type Cache files by extension, regardless of path. Enter extensions without dots. Separate multiple extensions with semicolons. Use letters and numbers only. m3u8;mpd;ts;m4s
Specific Directory Cache resources under one or more directory paths. Enter one directory path per line. Each path must start and end with /. /live/123/
URL Regular Expression Cache resources that match a regular expression. Enter the path-matching part of the regular expression. Do not include the protocol or domain. live/.*\.(m3u8\|mpd\|ts\|m4s)($\|.*)

For URL Regular Expression, the platform automatically prepends ^https?://[^/]+/ to the pattern.

Configure query string rules

Query string rules control whether query parameters form part of the cache key and whether the CDN forwards them to origin. These are separate settings: ignoring parameters in the cache key does not necessarily remove them from origin requests.

Add a query string rule

  1. Go to Configuration, select the target domain, and open Cache Optimization.
  2. In Query String Rules, choose Add.
  3. In the Query String Rules dialog, configure the scope and query string options.
Field Required Default Description
Rule Scope Yes - Select the resource scope: Specific File Type, Specific Directory, or URL Regular Expression.
Ignore Query String Yes Yes Select Yes to let URLs with different query strings share one cached copy. Select No to cache each unique query string separately.
Remove Query String from Origin Requests Yes Yes Select Yes to strip the query string before forwarding the request to origin. Select No to forward the query string to origin.
Case-Insensitive Match Yes Yes Select Yes to ignore letter case during matching.
Priority Yes 10 Set the match priority. A higher value has higher priority.
  1. Choose Confirm.

Query string handling examples

Goal Ignore Query String Remove Query String from Origin Requests
Share one cached copy across all query string variants and send a clean URL to origin. Yes Yes
Share one cached copy across all query string variants and send the full URL to origin. Yes No
Cache each query string variant separately and send a clean URL to origin. No Yes
Cache each query string variant separately and send the full URL to origin. No No

Save and submit changes

After confirming a rule or changing a switch, review the configuration. Save Draft saves your work as a draft. To continue through review and submission, choose Next and follow the console prompts. Before testing, check the domain’s configuration status and confirm that the changes have taken effect.

Choose cache TTLs

Live playlists and manifests update frequently. Choose a short TTL that matches their update cadence so players can obtain current versions. Media segments can use a longer TTL when their content does not change.

Review the domain’s existing Cache Rules and priorities before changing TTLs.

Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!