CLI
CDN commands
Create deployments, manage domains, and purge cache from your terminal.
On this page6 sections
Deployments#
List deployments#
Text
$ edge cdn list
ID NAME DOMAINS STATUS CREATED
cdn-abc123 production 3 active 2025-01-15
cdn-def456 staging 1 active 2025-02-01
cdn-ghi789 legacy 2 active 2024-12-10Create a deployment#
Text
$ edge cdn create --name my-cdn
Creating CDN deployment... done
ID: cdn-jkl012
Name: my-cdn
Status: active
Add a domain to start using your CDN:
edge cdn domains add cdn-jkl012 --domain cdn.example.com --origin https://origin.example.comGet deployment details#
Text
$ edge cdn get cdn-abc123
ID: cdn-abc123
Name: production
Status: active
Created: 2025-01-15 10:30:00 UTC
Domains:
cdn.example.com → https://origin.example.com SSL: active
assets.example.com → storage://my-bucket SSL: active
static.example.com → https://s3.amazonaws.com/... SSL: active
Statistics (24h):
Requests: 1,245,678
Bandwidth: 45.2 GB
Cache Hit: 94.5%Delete a deployment#
Terminal
# Delete with confirmation
edge cdn delete cdn-abc123
# Delete without confirmation
edge cdn delete cdn-abc123 --yesDomains#
List domains#
Text
$ edge cdn domains list cdn-abc123
DOMAIN ORIGIN SSL CACHE TTL
cdn.example.com https://origin.example.com active 86400s
assets.example.com storage://my-assets active 604800s
static.example.com https://s3.amazonaws.com/... active 2592000sAdd a domain#
Terminal
# Add domain with external origin
edge cdn domains add cdn-abc123 \
--domain cdn.example.com \
--origin https://origin.example.com \
--cache-ttl 86400
# Add domain with Storage bucket as origin
edge cdn domains add cdn-abc123 \
--domain assets.example.com \
--origin-type storage \
--storage-bucket my-assets
# Enable JIT image optimization
edge cdn domains add cdn-abc123 \
--domain images.example.com \
--origin https://origin.example.com \
--jit-imageUpdate a domain#
Terminal
# Update origin
edge cdn domains update cdn-abc123 dom-xyz789 \
--origin https://new-origin.example.com
# Update cache TTL
edge cdn domains update cdn-abc123 dom-xyz789 \
--cache-ttl 3600Remove a domain#
Terminal
edge cdn domains remove cdn-abc123 dom-xyz789Cache purging#
Purge all#
Text
$ edge cdn purge cdn-abc123
Purging all cached content... done
Cache cleared for all domains in cdn-abc123Selective purge#
Terminal
# Purge specific path
edge cdn purge cdn-abc123 --path /images/*
# Purge specific URL
edge cdn purge cdn-abc123 --url https://cdn.example.com/asset.js
# Purge multiple paths
edge cdn purge cdn-abc123 --path /css/* --path /js/*Metrics#
Text
$ edge cdn metrics cdn-abc123
Period: Last 24 hours
Total Requests: 1,245,678
Bandwidth: 45.2 GB
Cache Hit Rate: 94.5%
Cache Misses: 68,412
By Domain:
cdn.example.com 892,345 requests 32.1 GB
assets.example.com 312,456 requests 10.8 GB
static.example.com 40,877 requests 2.3 GBTerminal
# Specify time period
edge cdn metrics cdn-abc123 --period 7d
# Filter by domain
edge cdn metrics cdn-abc123 --domain cdn.example.com
# Export as CSV
edge cdn metrics cdn-abc123 --export csv > cdn-metrics.csvCommon flags#
| Flag | Description |
|---|---|
--name, -n |
Deployment name |
--domain |
Domain hostname |
--origin |
Origin URL |
--origin-type |
Origin type: url or storage |
--storage-bucket |
Storage bucket name (when --origin-type is storage) |
--cache-ttl |
Cache TTL in seconds |
--jit-image |
Enable JIT image optimisation |
--path |
Path pattern to purge |
--url |
Specific URL to purge |
--yes, -y |
Skip confirmation prompts |
Next steps
Something unclear or out of date? Tell us