All Products
Search
Document Center

Edge Security Acceleration:Purge cache by URL with regular expressions

Last Updated:Jun 18, 2026

You can submit URLs that contain regular expressions in a purge task. Alibaba Cloud and DCDN then purge all URLs that match the specified regular expression, enabling you to purge content with greater precision.

Usage notes

When you set the operation method to regular expression, you can submit URLs that contain regular expressions to purge all matching URLs in bulk. The following rules apply:

  • You can specify URLs that contain only the following four regular expressions in the URL field. Do not enter any regular expressions other than these four patterns:

    • [0-9]: Matches any single digit (0-9). Example: img[0-9].jpg matches img0.jpg through img9.jpg. Useful for purging resources by version number or index.

    • [a-z]: Matches any single lowercase letter (a-z). Example: file[a-z].txt matches filea.txt through filez.txt. Useful for purging resources by letter identifier.

    • [^/]*: Matches a single path segment (any character sequence that does not contain /). Example: cdn.aliyun.com/[^/]*.js matches all JS files in the root directory, such as cdn.aliyun.com/main.js and cdn.aliyun.com/app.js. Useful for purging resources of a specific file type within a directory.

    • .*: Matches any path segment (any character sequence including /). Example: cdn.aliyun.com/.* matches all resources under the domain. Useful for full purge scenarios.

    You can combine these patterns. For example: http://www.example.com/[0-9][a-z].*.jpg

  • Enter one rule per line. For example: http://www.example.com/[0-9][a-z].*.jpg

  • By default, each account is limited to 20 purge by regular expression tasks per day. If the peak daily bandwidth of your Alibaba Cloud account exceeds 10 Gbps, you can submit a ticket to request a higher daily quota.

  • URL purge, directory purge, and purge by regular expression all support cache sharing. If cache sharing is enabled for a domain name, you can purge the cache by submitting the task using either the primary or any associated domain name.

  • Before submitting a purge task, URL-encode any URLs with non-ASCII characters (such as spaces, Chinese characters, or special characters). The system cannot recognize tasks with unencoded URLs.

Procedure

  1. Log on to the DCDN console.

  2. Click Tools > Purge and Prefetch.

  3. On the Purge Cache tab, set Operation Method to Regular Expression.

    Refresh resources based on regular expressions

  4. Configure the rules and click Submit.