Skip to main content
Purge invalidates cached content for a distribution. Prefetch asks the delivery system to retrieve selected paths before expected traffic. Neither operation changes the origin file or clears a visitor’s browser cache.

Before purging

Correct the file at the origin or fix the cache policy first. Otherwise, the next request can cache the same unwanted response again. Select the correct project and distribution. For API examples, complete credential setup and replace distribution ID 73 with your own.

Choose a purge mode

Use paths beginning with /, such as /assets/app.css, rather than complete URLs. Paths containing a URL scheme, .., backslashes, repeated slashes, or control characters are rejected. Prefer the smallest affected set. Purging all content removes useful cached objects and can increase origin traffic.

Purge specific paths

In the console, use the distribution’s purge tool, select URL mode, and enter the affected paths. The equivalent API request is:
The operation returns 201 on success. Do not require a JSON response body.

Check history and delivery

Read recent purge operations for the key’s project:
Match the distribution ID, paths, and request time. History includes status and an error message when available. Then request the affected URL through the CDN and verify the new content. An operation result does not prove every visitor has discarded an old browser copy. If the browser remains stale while a fresh request is correct, inspect browser freshness and service-worker behavior. Prefer versioned asset URLs for future releases.

Prefetch selected files

Use prefetch for a controlled set of public, high-demand paths after they are available at the origin.
Prefetch accepts 1–100 paths and returns 201 on success. It is not an unbounded site crawl and does not guarantee that an uncacheable response becomes cacheable. Inspect recent operations through GET /cloud-cdn/tools/prefetch/history and test delivery.

Handle failures

See caching when the same content repeatedly needs purging.