搜尋⋯
on

API 清除緩存操作

API Token Headers

以下 API 皆需 API Token 相關 Header

  • SKC-RefreshToken
  • SKC-AccessToken

清除全部快取

DELETE /api/v1/user/site/{siteID}/setting/currentCache

描述

根據站點 ID 清除此站點下的所有域名緩存

cURL 範例

curl --request DELETE \
    --header "SKC-RefreshToken: {Your Refresh Token}" \
    --header "SKC-AccessToken: {Your Access Token}" \
    {CDNRay API Endpoint}/api/v1/user/site/{siteID}/setting/currentCache

詳細內容

  • Payload:
  • Response
{ "code": 101001 }

清除URL快取:前綴匹配

DELETE /api/v1/user/site/{siteID}/setting/urlCache

描述

匹配後,後面的目錄全部清除

cURL 範例

curl --request DELETE \
    --header 'Content-Type: application/json' \
    --header "SKC-RefreshToken: {Your Refresh Token}" \
    --header "SKC-AccessToken: {Your Access Token}" \
    --data '{ "type":1, "urls":["http://example.com/"] }' \
    '{CDNRay API Endpoint}/api/v1/user/site/{siteID}/setting/urlCache'

詳細內容

  • Payload:
{ 
    "type":1,
    "urls":["http://example.com/"]
}
  • Response:
{ "code": 101001 }

清除URL快取:完全匹配

DELETE /api/v1/user/site/{siteID}/setting/urlCache

描述

匹配後,完整路徑符合者完全清除

cURL 範例

curl --request DELETE \
    --header 'Content-Type: application/json' \
    --header "SKC-RefreshToken: {Your Refresh Token}" \
    --header "SKC-AccessToken: {Your Access Token}" \
    --data '{ "type":2, "urls":["http://example.com/123.jpg"] }' \
    '{CDNRay API Endpoint}/api/v1/user/site/{siteID}/setting/urlCache'

詳細內容

  • Payload:
{ 
    "type":2,
    "urls":["http://example.com/123.jpg"]
}
  • Response:
{ "code": 101001 }

清除URL快取:正則匹配

DELETE /api/v1/user/site/{siteID}/setting/urlCache

描述

根據語法規則清除特定的URL

cURL 範例1

  • 指定所有特定URI包含static,但不指定域名
curl --request DELETE \
    --header 'Content-Type: application/json' \
    --header "SKC-RefreshToken: {Your Refresh Token}" \
    --header "SKC-AccessToken: {Your Access Token}" \
    --data '{ "type":3, "urls":["*/static/*"] }' \
    '{CDNRay API Endpoint}/api/v1/user/site/{siteID}/setting/urlCache'

詳細內容

  • Payload:
{ 
    "type":3,
    "urls":["*/static/*"]
}
  • Response:
{ "code": 101001 }

cURL 範例2

  • 指定特定域名下所有URL
curl --request DELETE \
    --header 'Content-Type: application/json' \
    --header "SKC-RefreshToken: {Your Refresh Token}" \
    --header "SKC-AccessToken: {Your Access Token}" \
    --data '{ "type":3, "urls":["www.example.com/*"] }' \
    '{CDNRay API Endpoint}/api/v1/user/site/{siteID}/setting/urlCache'

詳細內容

  • Payload:
{ 
    "type":3,
    "urls":["www.example.com/*"]
}
  • Response:
{ "code": 101001 }

cURL 範例3

  • 指定特定域名、特定URI包含static
curl --request DELETE \
    --header 'Content-Type: application/json' \
    --header "SKC-RefreshToken: {Your Refresh Token}" \
    --header "SKC-AccessToken: {Your Access Token}" \
    --data '{ "type":3, "urls":["www.example.com/*/static/*"] }' \
    '{CDNRay API Endpoint}/api/v1/user/site/{siteID}/setting/urlCache'

詳細內容

  • Payload:
{ 
    "type":3,
    "urls":["www.example.com/*/static/*"]
}
  • Response:
{ "code": 101001 }
iconiconiconiconicon