b2c-ecdn

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

B2C eCDN Skill

B2C eCDN 技能

Use the
b2c
CLI plugin to manage eCDN (embedded Content Delivery Network) zones, certificates, security settings, and more.
Tip: If
b2c
is not installed globally, use
npx @salesforce/b2c-cli
instead (e.g.,
npx @salesforce/b2c-cli ecdn zones list
).
使用
b2c
CLI插件来管理eCDN(嵌入式内容分发网络)区域、证书、安全设置等内容。
提示: 如果
b2c
没有全局安装,请改用
npx @salesforce/b2c-cli
(例如:
npx @salesforce/b2c-cli ecdn zones list
)。

Prerequisites

前提条件

  • OAuth credentials with
    sfcc.cdn-zones
    scope (read operations)
  • OAuth credentials with
    sfcc.cdn-zones.rw
    scope (write operations)
  • Tenant ID for your B2C Commerce organization
  • 拥有
    sfcc.cdn-zones
    权限范围的OAuth凭证(读取操作)
  • 拥有
    sfcc.cdn-zones.rw
    权限范围的OAuth凭证(写入操作)
  • 你的B2C Commerce组织的租户ID

Examples

示例

List CDN Zones

列出CDN区域

bash
undefined
bash
undefined

list all CDN zones for a tenant

list all CDN zones for a tenant

b2c ecdn zones list --tenant-id zzxy_prd
b2c ecdn zones list --tenant-id zzxy_prd

list with JSON output

list with JSON output

b2c ecdn zones list --tenant-id zzxy_prd --json
undefined
b2c ecdn zones list --tenant-id zzxy_prd --json
undefined

Create a Storefront Zone

创建店面区域

bash
undefined
bash
undefined

create a new storefront zone

create a new storefront zone

b2c ecdn zones create --tenant-id zzxy_prd --storefront-hostname www.example.com --origin-hostname origin.example.com
undefined
b2c ecdn zones create --tenant-id zzxy_prd --storefront-hostname www.example.com --origin-hostname origin.example.com
undefined

Purge Cache

清除缓存

bash
undefined
bash
undefined

purge cache for specific paths

purge cache for specific paths

b2c ecdn cache purge --tenant-id zzxy_prd --zone my-zone --path /products --path /categories
b2c ecdn cache purge --tenant-id zzxy_prd --zone my-zone --path /products --path /categories

purge by cache tags

purge by cache tags

b2c ecdn cache purge --tenant-id zzxy_prd --zone my-zone --tag product-123 --tag category-456
b2c ecdn cache purge --tenant-id zzxy_prd --zone my-zone --tag product-123 --tag category-456

purge everything

purge everything

b2c ecdn cache purge --tenant-id zzxy_prd --zone my-zone --purge-everything
undefined
b2c ecdn cache purge --tenant-id zzxy_prd --zone my-zone --purge-everything
undefined

Manage Certificates

管理证书

bash
undefined
bash
undefined

list certificates for a zone

list certificates for a zone

b2c ecdn certificates list --tenant-id zzxy_prd --zone my-zone
b2c ecdn certificates list --tenant-id zzxy_prd --zone my-zone

add a new certificate

add a new certificate

b2c ecdn certificates add --tenant-id zzxy_prd --zone my-zone --hostname www.example.com --certificate-file ./cert.pem --private-key-file ./key.pem
b2c ecdn certificates add --tenant-id zzxy_prd --zone my-zone --hostname www.example.com --certificate-file ./cert.pem --private-key-file ./key.pem

get certificate details

get certificate details

b2c ecdn certificates get --tenant-id zzxy_prd --zone my-zone --certificate-id abc123
b2c ecdn certificates get --tenant-id zzxy_prd --zone my-zone --certificate-id abc123

validate a custom hostname

validate a custom hostname

b2c ecdn certificates validate --tenant-id zzxy_prd --zone my-zone --certificate-id abc123
undefined
b2c ecdn certificates validate --tenant-id zzxy_prd --zone my-zone --certificate-id abc123
undefined

Security Settings

安全设置

bash
undefined
bash
undefined

get security settings

get security settings

b2c ecdn security get --tenant-id zzxy_prd --zone my-zone
b2c ecdn security get --tenant-id zzxy_prd --zone my-zone

update security settings

update security settings

b2c ecdn security update --tenant-id zzxy_prd --zone my-zone --ssl-mode full --min-tls-version 1.2 --always-use-https
undefined
b2c ecdn security update --tenant-id zzxy_prd --zone my-zone --ssl-mode full --min-tls-version 1.2 --always-use-https
undefined

Speed Settings

速度设置

bash
undefined
bash
undefined

get speed optimization settings

get speed optimization settings

b2c ecdn speed get --tenant-id zzxy_prd --zone my-zone
b2c ecdn speed get --tenant-id zzxy_prd --zone my-zone

update speed settings

update speed settings

b2c ecdn speed update --tenant-id zzxy_prd --zone my-zone --browser-cache-ttl 14400 --auto-minify-html --auto-minify-css
undefined
b2c ecdn speed update --tenant-id zzxy_prd --zone my-zone --browser-cache-ttl 14400 --auto-minify-html --auto-minify-css
undefined

Additional Topics

其他主题

For less commonly used eCDN features, see the reference files:
  • SECURITY.md — WAF (v1 and v2), custom firewall rules, rate limiting, and Page Shield (CSP policies, script detection, notification webhooks)
  • ADVANCED.md — Logpush jobs, MRT routing rules, mTLS certificates, cipher suite configuration, and origin header modification
针对不太常用的eCDN功能,请查阅参考文件:
  • SECURITY.md — WAF(v1和v2)、自定义防火墙规则、速率限制和Page Shield(CSP策略、脚本检测、通知webhook)
  • ADVANCED.md — Logpush作业、MRT路由规则、mTLS证书、密码套件配置和源站头部修改

Configuration

配置

The tenant ID can be set via environment variable:
  • SFCC_TENANT_ID
    : B2C Commerce tenant ID
The
--zone
flag accepts either:
  • Zone ID (32-character hex string)
  • Zone name (human-readable, case-insensitive lookup)
租户ID可通过环境变量设置:
  • SFCC_TENANT_ID
    : B2C Commerce租户ID
--zone
参数可接受以下两种值:
  • 区域ID(32位十六进制字符串)
  • 区域名称(人类可读,不区分大小写查找)

OAuth Scopes

OAuth权限范围

OperationRequired Scope
Read operations
sfcc.cdn-zones
Write operations
sfcc.cdn-zones.rw
操作所需权限范围
读取操作
sfcc.cdn-zones
写入操作
sfcc.cdn-zones.rw

More Commands

更多命令

See
b2c ecdn --help
for a full list of available commands and options in the
ecdn
topic.
查看
b2c ecdn --help
获取
ecdn
主题下所有可用命令和选项的完整列表。