# Page Rules

Page Rules for **Dynamic Content Acceleration** operate the same way as in **Static Content Delivery**.\
They allow you to apply **rule-based caching and optimization logic** for specific URL paths and file extensions.\
This enables fine-grained control over performance behavior for dynamic applications, APIs and mixed static–dynamic workloads.

Use Page Rules when you need to override the default caching logic, apply custom TTLs, control headers, or modify delivery behavior for selected routes.

For full configuration steps and available rule types, refer to the main Page Rules documentation:

**Learn more:** [Page Rules Documentation](https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/page-rules)

### Dynamic Page Cache Behavior

Dynamic Content Acceleration accounts include an additional setting under Page Rules: **Dynamic Page Cache**.

This setting controls **whether HTML, JSON and other dynamic text-based responses can be cached using the TTL defined in a Page Rule**.

<figure><img src="/files/kVb1O75iXopAoDBy2qJj" alt="" width="450"><figcaption><p>Dynamic Page Cache setting visible only for Dynamic Content Acceleration</p></figcaption></figure>

#### How Dynamic Page Cache Works

<table><thead><tr><th width="185">Dynamic Page Cache</th><th>Behavior</th></tr></thead><tbody><tr><td><strong>Off (false)</strong></td><td>The Page Rule TTL applies <strong>only to static file types</strong> (e.g., images, CSS, JS). Dynamic content such as <strong>HTML and JSON is never cached</strong>, even if a TTL is configured.</td></tr><tr><td><strong>On (true)</strong></td><td>The CDN <strong>caches HTML, JSON and similar dynamic responses</strong> for the TTL defined in the Page Rule. Static files continue to be cached as usual.</td></tr></tbody></table>

#### When to Enable Dynamic Page Cache

Enable this option if your application can safely serve cached HTML/JSON responses for the specified duration — for example:

* Landing pages with infrequent updates
* API responses that are cache-friendly
* Server-rendered pages that do not change per user

Leave it **disabled** for:

* Personalized pages
* User-specific HTML
* Sensitive JSON or rapidly changing dynamic data

### Supported Rule Components

Dynamic Content Acceleration supports the same rule components as Static Content Delivery:

* **File Path Match** (directory, wildcard, regex)
* **File Extensions**
* **Cache Type and TTL**
* **Header settings**
* **Redirect and security settings**

All rule logic is evaluated in the same manner as Static Content Delivery.

### Example Use Case

**Scenario:**\
A customer wants to cache HTML responses under `/blog/` for 30 seconds but does not want to cache dashboard or personalized pages.

**Configuration:**

* File Path: `/blog/`
* File Extension: `html`
* Cache Type: Edge
* Edge Cache Time: `30s`
* **Dynamic Page Cache: On**

Result:\
HTML pages under `/blog/` are cached for 30 seconds. Other dynamic pages remain uncached.

### Notes

* Page Rules override the global Caching tab for matching requests.
* Dynamic Page Cache applies **only if** the rule includes a TTL.
* When disabled, dynamic responses always result in an origin fetch.
* Behavior is identical across Small, Large and Dynamic Resources, except the **Dynamic Page Cache** setting, which is exclusive to Dynamic Content Acceleration.

***

## Streaming Content Caching

Streaming Content Caching resources use a **fixed set of 4 predefined page rules** instead of dynamic, user-created rules.\
Unlike other resource types, you **cannot add or remove** page rules — the rules come pre-configured to match standard streaming content patterns (HLS, DASH and Smooth Streaming).\
However, you can customize **per-rule settings** to control how each content type is delivered.

<figure><img src="/files/ZVmEEHpybzzcZiA2HjD6" alt=""><figcaption><p>Page Rules overview for Streaming Content Caching — 4 predefined rules</p></figcaption></figure>

### The 4 Default Page Rules

<table><thead><tr><th width="100">Rule ID</th><th width="140">File Name</th><th width="280">File Extensions</th><th>Purpose</th></tr></thead><tbody><tr><td>1</td><td>-</td><td>.m3u8</td><td>HLS manifest files</td></tr><tr><td>2</td><td>-</td><td>.mpd</td><td>DASH manifest files</td></tr><tr><td>3</td><td>Manifest</td><td>-</td><td>Smooth Streaming manifest files</td></tr><tr><td>4</td><td>Fragment.*</td><td>.ts, .dash, .m4s, .m4a, .mp4, .m4v</td><td>Media segment/fragment files</td></tr></tbody></table>

* Rules 1–3 are **manifest** rules — they match playlist and index files that players fetch first to discover available streams.
* Rule 4 is a **segment** rule — it matches the actual media chunks (video/audio fragments) that are downloaded during playback.

### Editing a Page Rule

Click the three-dot menu (**⋮**) on any rule to open the **Update a Page Rule** dialog.

<figure><img src="/files/J4RJZa7FKxxyBguicQhN" alt="" width="450"><figcaption><p>Update a Page Rule dialog for Streaming Content Caching</p></figcaption></figure>

The dialog contains:

* **File Name** and **File Extensions** — these are read-only and show the predefined matching criteria for the rule.
* **Settings section** — use the "Select a setting" dropdown to choose a setting, then click **Add a setting** to include it in the rule.

> **Note:** All settings you add or remove from the settings section will only be visually added or removed on the interface side. Settings that you do not see in the interface will still be processed with their necessary default values.

Click **Update** to save your changes.

### Default vs Custom Setting Mode

Each setting added to a page rule has a **type selector** with two options:

<table><thead><tr><th width="140">Type</th><th>Behavior</th></tr></thead><tbody><tr><td><strong>Default</strong></td><td>The setting <strong>inherits its value</strong> from the main configuration area (e.g., Caching tab, Headers tab). Any changes you make in those tabs will automatically apply to all page rules using Default mode.</td></tr><tr><td><strong>Custom</strong></td><td>The setting uses a <strong>value defined specifically for this page rule</strong>. This value is independent of the main configuration and only applies to requests matching this rule.</td></tr></tbody></table>

<figure><img src="/files/qZ2uUtHpogLlAtxKSFEw" alt="" width="450"><figcaption><p>CORS setting with Default type — inherits from the global Headers configuration</p></figcaption></figure>

<figure><img src="/files/puVOijw4NtawilK0fflf" alt="" width="450"><figcaption><p>CORS setting with Custom type — allows specifying custom CORS domains for this rule only</p></figcaption></figure>

### Available Settings

The following settings can be configured per page rule via the "Select a setting" dropdown:

<table><thead><tr><th width="200">Setting</th><th width="180">Default / Custom</th><th>Description</th></tr></thead><tbody><tr><td><strong>CORS</strong></td><td>Supported</td><td>Enable cross-origin resource sharing. Default inherits allowed origins from the Headers configuration. Custom lets you specify allowed domains per rule.</td></tr><tr><td><strong>Custom Header</strong></td><td>Supported</td><td>Add custom response headers. Default uses headers defined in the Headers tab. Custom allows rule-specific headers.</td></tr><tr><td><strong>Geo Blocking</strong></td><td>Independent</td><td>Restrict access based on geographic location. Requires both account-level geo blocking <strong>and</strong> the page-rule-level setting to be enabled.</td></tr><tr><td><strong>Hotlink Protection</strong></td><td>Supported</td><td>Restrict access based on referring domains. Default inherits from the Security configuration. Custom allows rule-specific domain lists.</td></tr><tr><td><strong>Rate Limiting</strong></td><td>Supported</td><td>Limit request rate per client. Default uses the global rate limit configuration. Custom creates rule-specific rate limit zones.</td></tr><tr><td><strong>Secure Link</strong></td><td>Independent</td><td>Enable token-based URL authentication for requests matching this rule.</td></tr><tr><td><strong>Security Headers</strong></td><td>Supported</td><td>Add security response headers (X-XSS-Protection, HSTS, etc.). Default inherits from the Headers configuration. Custom allows rule-specific values.</td></tr></tbody></table>

### Example: Custom CORS for DASH Manifests

**Scenario:**\
CORS is enabled globally with Default type across all rules, but `.mpd` (DASH manifest) requests need to allow a specific set of origins that differ from the global configuration.

**Configuration:**

1. Open the Page Rules tab for your Streaming Content Caching resource.
2. Click **⋮** on Rule ID 2 (`.mpd`) and select Edit.
3. Add the **CORS** setting from the dropdown.
4. Switch the CORS Type from **Default** to **Custom**.
5. Enter the allowed CORS domains and click **Update**.

**Result:**\
`.mpd` requests return CORS headers with the custom domain list. All other rules (`.m3u8`, `Manifest`, `Fragment.*`) continue using the global CORS configuration from the Headers tab.

### Notes

* The 4 predefined rules cannot be added, removed, or reordered.
* File Name and File Extension matching criteria are fixed and cannot be modified.
* When a setting is not explicitly added to a rule, it uses its **default** behavior from the main configuration.
* Settings with **Independent** mode (Geo Blocking, Secure Link) do not have a Default/Custom toggle — they are either enabled or disabled per rule.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clients.medianova.com/products/performance-cdn/dynamic-content-acceleration/advanced-configuration/page-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
