All Products
Search
Document Center

CDN:Ignore parameters

Last Updated:Sep 21, 2026

When you enable parameter ignoring, CDN edge nodes remove query parameters (the part after the ?) from request URLs. This allows requests with different parameters to hit the same cached copy, improving the cache hit ratio. This topic describes how to configure parameter ignoring, compares it with alternative features, and provides usage suggestions.

Feature comparison

  • Custom Cache Key conflicts with parameter ignoring. If you configure both parameter ignoring and Custom Cache Key at the same time, parameter ignoring becomes invalid.

  • Custom Cache Key can replace parameter ignoring for cache key configuration and offers more comprehensive functionality. We recommend using it first. Configuration comparison:

    Scenario

    Parameter ignoring

    Custom Cache Key

    Ignore all request parameters in the cache key

    Set Ignore Parameters to Yes and leave Retain Specified Parameters empty.

    Add a request parameter handling rule:

    • Action: Retain

    • Parameter name: Set to any non-existent parameter name, such as example-argument.

    Retain only request parameter key1 in the cache key

    Set Ignore Parameters to Yes and set Retain Specified Parameters to key1.

    Add a request parameter handling rule:

    • Action: Retain

    • Parameter name: key1

    Delete only request parameter key1 from the cache key

    Delete the parameter setting for key1.

    Add a request parameter handling rule:

    • Action: Delete

    • Parameter name: key1

  • Rewrite Origin Parameters can replace parameter ignoring for origin request rewriting and offers more comprehensive functionality. We recommend using it first.

Feature overview

Ignore parameters

Function

Scenarios

Removes query parameters (the part after ?) from request URLs so that requests with different parameters hit the same cache file. This improves the cache hit ratio and reduces back-to-origin traffic.

Enable parameter ignoring when URL parameters are unrelated to resource content (such as user UID, referral source, or promo codes). For example, these two requests access the same resource but carry different UIDs:

User A: http://example.com/1.jpg?uid=123***

User B: http://example.com/1.jpg?uid=654***

Without parameter ignoring, CDN edge nodes treat these as different resources and cannot share the same cache, requiring an origin fetch for each request. With parameter ignoring enabled, CDN edge nodes strip the parameters and use http://example.com/1.jpg to match the cache.

Note

URL signing takes precedence over parameter ignoring. Type A signing includes URL parameters in its signature. CDN performs authentication first and caches the replica only after successful validation.

Retain origin parameters

Function

Scenarios

Retains all original URL parameters during origin fetches to ensure the origin server receives critical user information.

When parameter ignoring is enabled, CDN edge nodes use the parameter-stripped URL for origin fetches by default. In the example above, both User A and User B would trigger an origin request to http://example.com/1.jpg, losing critical information like UID. Enabling Retain Origin Parameters ensures CDN uses the original URL for origin fetches, preserving parameters like UID for the origin server.

Procedure

  1. Log on to the CDN console.

  2. In the navigation pane on the left, click Domain Names.

  3. In the domain list, click the target domain name. In the navigation pane on the left, click Optimization to go to the performance optimization configuration page.

  4. Click Modify in the Ignore Parameters section. Select a mode and complete the configuration based on your needs.

  5. After completing the configuration, click OK to save.

Important
  • Switching modes clears existing configurations.

  • After modifying the parameter ignoring configuration, cached files on edge nodes do not update automatically. You must perform a URL refresh or directory refresh in the console to apply the new configuration and purge old cache. Otherwise, users might still access content cached under the old policy, causing access issues.

Mode: Retain specified parameters

Parameter

Description

Example

Ignore Parameters

  • Yes: Enable parameter ignoring to remove all parameters after ? in the URL.

    Note

    If you enable Ignore Parameters but leave Retain Specified Parameters empty, all parameters after ? are removed.

  • No: Disable parameter ignoring to retain all URL parameters.

Assume the original URL is http://example.com/1.jpg?key1=1&key2=2&key3=3. The results for each configuration are as follows:

  • Example 1, ignore all parameters, do not retain origin parameters:

    • Configuration: Ignore Parameters=Yes, Retain Specified Parameters empty, Retain Origin Parameters=No.

    • Cache key: http://example.com/1.jpg

    • Origin URL: http://example.com/1.jpg

  • Example 2, retain specified parameters, do not retain origin parameters:

    • Configuration: Ignore Parameters=Yes, Retain Specified Parameters=key1, Retain Origin Parameters=No.

    • Cache key: http://example.com/1.jpg?key1=1

    • Origin URL: http://example.com/1.jpg?key1=1

  • Example 3, ignore all parameters, retain origin parameters:

    • Configuration: Ignore Parameters=Yes, Retain Specified Parameters empty, Retain Origin Parameters=Yes.

    • Cache key: http://example.com/1.jpg

    • Origin URL: http://example.com/1.jpg?key1=1&key2=2&key3=3

  • Example 4, retain specified parameters, retain origin parameters:

    • Configuration: Ignore Parameters=Yes, Retain Specified Parameters=key1, Retain Origin Parameters=Yes.

    • Cache key: http://example.com/1.jpg?key1=1

    • Origin URL: http://example.com/1.jpg?key1=1&key2=2&key3=3

Retain Specified Parameters

Enter parameter names to retain. You can specify up to 10 parameters, separated by commas (,).

Retain Origin Parameters

  • Yes: Retain all original URL parameters during origin fetches.

  • No: During origin fetches, include only parameters consistent with the cache hash key (that is, the retained parameters).

Rule Condition

A rule condition identifies various parameter information in a user request. This determines whether a configuration takes effect for that request.

Important

When you reference rule conditions, they are matched based on the priority of the associated rule conditions, not the configuration order of the feature itself.

  • Do not use: Does not use a rule condition.

  • To add or edit rule conditions, manage them in the Rules Engine.

Mode: Delete specified parameters

Parameter

Description

Example

Remove Specified Parameters

Enter parameter names to delete. You can specify up to 10 parameters, separated by spaces.

Assume the original URL is http://example.com/1.jpg?key1=1&key2=2&key3=3. The results for each configuration are as follows:

  • Example 1, delete specified parameters, do not retain origin parameters:

    • Configuration: Delete Specified Parameters=key1, Retain Origin Parameters=No.

    • Cache key: http://example.com/1.jpg?key2=2&key3=3

    • Origin URL: http://example.com/1.jpg?key2=2&key3=3

  • Example 2, delete specified parameters, retain origin parameters:

    • Configuration: Delete Specified Parameters=key1, Retain Origin Parameters=Yes.

    • Cache key: http://example.com/1.jpg?key2=2&key3=3

    • Origin URL: http://example.com/1.jpg?key1=1&key2=2&key3=3

Retain Origin Parameters

  • Yes: Retain all original URL parameters during origin fetches.

  • No: During origin fetches, include only parameters consistent with the cache hash key (that is, the result after deleting specified parameters).

Rule Condition

A rule condition identifies various parameter information in a user request. This determines whether a configuration takes effect for that request.

Important

When you reference rule conditions, they are matched based on the priority of the associated rule conditions, not the configuration order of the feature itself.

  • Do not use: Does not use a rule condition.

  • To add or edit rule conditions, manage them in the Rules Engine.

Usage scenario examples

Using parameter ignoring to mitigate cache-bypass attacks via URL parameters

When attackers or crawlers add random meaningless parameters (such as ?timestamp=xxx or ?random=xxx) to request the same resource, CDN treats each parameterized request as a unique resource. This reduces cache hit ratio and spikes back-to-origin traffic.

Enable parameter ignoring (or configure it to ignore all parameters) so requests with different random parameters hit the same cache, effectively reducing origin pressure. For example, after enabling parameter ignoring, these requests hit the same cache:

  • http://example.com/page.html?t=123456

  • http://example.com/page.html?t=789012

  • http://example.com/page.html?random=abc

With parameter ignoring enabled, all these requests use http://example.com/page.html to match the cache, effectively mitigating cache-bypass attacks via URL parameters.