Skip to main content

tcb domains cache purge

Purge the CDN or EdgeOne (EO) cache of an HTTP access service domain. The domain must already use CDN or EdgeOne.

Usage​

tcb domains cache purge <targets...> -d <domain> [options]

Parameters​

ParameterRequiredDescriptionDefault
<targets...>YesPurge targets, at most 20 per call, 2048 characters each—
-d, --domain <domain>YesHTTP access service domain—
-t, --type <type>NoGranularity: url / prefix / host; a target ending with / becomes prefixurl
-c, --cache-type <cacheType>Nocdn / eo, detected from the domain access typeDetected
-w, --waitNoWait for the purge to finish, useful in CI/CDfalse
-e, --env-id <envId>NoEnvironment IDenvId in the configuration

Granularity:

GranularityDescriptionScope
urlExact URL, must carry the http:// or https:// prefixCDN, EO
prefixDirectory, must carry the protocol prefix, for example https://example.com/static/EO only
hostWhole domain, bare domain or with protocolEO only

Examples​

# Purge a single URL
tcb domains cache purge https://example.com/index.html -d example.com -e <envId>

# Purge several URLs
tcb domains cache purge https://example.com/a.js https://example.com/b.css -d example.com -e <envId>

# Directory purge (EO only)
tcb domains cache purge https://example.com/static/ -d example.com -e <envId> -t prefix

# Domain purge (EO only)
tcb domains cache purge https://example.com -d example.com -e <envId> -t host

# Explicit cache type, waiting for completion
tcb domains cache purge https://example.com/index.html -d example.com -e <envId> -c eo --wait

Notes​

  • The domain must use CDN or EdgeOne before caching applies
  • CDN domains only purge by exact URL; directory and domain purges are EdgeOne features
  • URL and directory targets need the http:// or https:// prefix
  • Cache purge does not support the platform edition (--platform-id)