Cloudflare Docs
Edit this page on GitHub
Set theme to dark (⇧+D)

Purge cache by prefix (Enterprise only)

Enterprise customers can purge their cache by URL prefix or path separators in their URL. For an example URL like, valid purge requests include:


Purging by prefix is useful in different scenarios, such as:

  • Purging everything within a directory.
  • Increasing control over cached objects in a path.
  • Simplifying the number of purge calls sent.
  1. Log in to your Cloudflare dashboard, and select your account and domain.
  2. Select Caching > Configuration.
  3. Under Purge Cache, select Custom Purge. The Custom Purge window appears.
  4. Under Purge by, select Prefix.
  5. Follow the syntax instructions.
    • One prefix per line.
    • Maximum 30 prefixes per API call.
  6. Enter the appropriate value(s) in the text field using the format shown in the example.
  7. Select Purge.

​​ Limitations

There are several limitations regarding purge by prefix:

  • Path separators are limited to 31 for a prefix (…).
  • Purge requests are limited to 30 prefixes per request.
  • Purge rate-limits apply.
  • URI query strings & fragments cannot purge by prefix:
    • (query string)
    • (fragment)

​​ Purge by prefix normalization

Using purge by prefix normalization, when a purge by prefix request comes into Cloudflare for a normalized URL path, the purge service respects the URL normalization and purges the normalized URL.

​​ How does URL Normalization work

Take the following website as an example:انشاء-موقع-الكتروني/img_1.jpg. The table below shows you how Cloudflare’s cache views these paths with normalization on/off.

Request from visitor to EDGEWhat Cloudflare cache sees with Normalize Incoming URLs ONWhat Cloudflare cache sees with Normalize Incoming URLs OFFانشاء-موقع-الكتروني/img_1.jpgانشاء-موقع-الكتروني/img_1.jpg

As shown above, with URL normalization ON, visitors to the two URLs, andانشاء-موقع-الكتروني/img_1.jpg, will be served the same cached asset. Purging will purge that asset for both visitors.