全部產品
Search
文件中心

Edge Security Acceleration:UpdateCacheRule - 修改網站緩衝配置

更新時間:Jan 30, 2026

修改緩衝配置。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

SiteId

integer

網站 ID,可通過調用 ListSites 介面擷取。

123456****

ConfigId

integer

配置 ID。

35281609698****

RuleName

string

規則名稱。添加全域配置的時候不需要設定該參數。

rule_example

RuleEnable

string

規則開關。添加全域配置的時候不需要設定該參數。取值範圍:

  • on:開啟。

  • off:關閉。

on

Rule

string

規則內容,使用條件運算式來匹配使用者請求。添加全域配置的時候不需要設定該參數。存在兩種使用情境:

  • 匹配所有傳入請求:值設定為 true

  • 匹配指定請求:值設定為自訂運算式,例如:(http.host eq "video.example.com")

(http.host eq \"video.example.com\")

BypassCache

string

設定繞過緩衝模式。取值範圍:

  • cache_all:所有請求都緩衝。

  • bypass_all:所有請求都繞過緩衝。

cache_all

BrowserCacheMode

string

瀏覽器緩衝模式。取值範圍:

  • no_cache:不緩衝。

  • follow_origin:遵循來源站點緩衝策略。

  • override_origin:代替來源站點緩衝策略。

no_cache

BrowserCacheTtl

string

瀏覽器緩衝到期時間,單位是秒。

300

EdgeCacheMode

string

節點緩衝模式。取值範圍:

  • follow_origin:遵循來源站點緩衝策略(如果存在),否則使用預設緩衝策略。

  • no_cache:不緩衝。

  • override_origin:代替來源站點緩衝策略。

  • follow_origin_bypass:遵循來源站點緩衝策略(如果存在),否則不緩衝。

  • follow_origin_override:遵循來源站點緩衝策略(如果存在),否則使用自訂緩衝 TTL。

follow_origin

EdgeCacheTtl

string

節點緩衝到期時間,單位是秒。

300

EdgeStatusCodeCacheTtl

string

狀態代碼緩衝到期時間,單位是秒。

  • 支援對指定狀態代碼設定緩衝到期時間,例如:404=10,表示對 404 狀態代碼緩衝 10 秒。

  • 支援對 4xx、5xx 系列狀態代碼設定緩衝到期時間,例如:4xx=10,表示對 400 系列的所有狀態代碼都緩衝 10 秒。

4xx=10

SortQueryStringForCache

string

查詢字串排序。取值範圍:

  • on:開啟。

  • off:關閉。

on

QueryStringMode

string

在產生緩衝鍵的時候,對查詢字串的處理模式。取值:

  • ignore_all:全部忽略。

  • exclude_query_string:刪除指定查詢字串。

  • reserve_all:預設值,全部保留。

  • include_query_string:保留指定查詢字串。

ignore_all

QueryString

string

需要保留或者刪除的查詢字串,支援輸入多個值,多個值之間用空格分隔。

example

IncludeHeader

string

產生緩衝鍵的時候,包括指定的標題名稱及其值,支援輸入多個值,多個值之間用空格分隔。

headername

IncludeCookie

string

產生緩衝鍵的時候,包括指定的 cookie 名稱及其值,支援輸入多個值,多個值之間用空格分隔。

cookiename

CacheReserveEligibility

string

緩衝保持資格。用於控制使用者請求在回源的時候是否繞過緩衝保持節點。取值範圍:

  • bypass_cache_reserve:請求繞過緩衝保持。

  • eligible_for_cache_reserve:符合緩衝保持資格。

bypass_cache_reserve

CheckPresenceHeader

string

產生緩衝鍵的時候,檢查 header 是否存在,如果存在,則在緩衝鍵中加入 header 名稱(header 名稱不區分大小寫)。支援輸入多個 header 名稱,多個值之間用空格分隔。

headername

CheckPresenceCookie

string

產生緩衝鍵的時候,檢查 cookie 是否存在,如果存在,則在緩衝鍵中加入 cookie 名稱(cookie 名稱不區分大小寫)。支援輸入多個 cookie 名稱,多個值之間用空格分隔。

cookiename

UserDeviceType

string

產生緩衝鍵的時候,加入用戶端裝置類型。取值範圍:

  • on:開啟。

  • off:關閉。

on

UserGeo

string

產生緩衝鍵的時候,加入用戶端地理位置。取值範圍:

  • on:開啟。

  • off:關閉。

on

UserLanguage

string

產生緩衝鍵的時候,加入用戶端語言類型。取值範圍:

  • on:開啟。

  • off:關閉。

on

ServeStale

string

響應到期緩衝。開啟之後,在原始伺服器停用情況下,節點依然可以使用已緩衝的到期檔案響應使用者請求。取值範圍:

  • on:開啟。

  • off:關閉。

on

AdditionalCacheablePorts

string

在指定連接埠上開啟緩衝功能。取值範圍:8880、2052、2082、2086、2095、2053、2083、2087、2096。

8880

CacheDeceptionArmor

string

緩衝欺騙防禦。用於防禦 Web 緩衝欺騙攻擊,通過校正的緩衝內容才會被緩衝下來。取值範圍:

  • on:開啟。

  • off:關閉。

on

Sequence

integer

規則執行順序,數值越小越優先執行。

1

PostCache

string

Post 緩衝功能開關。

on

PostBodySizeLimit

string

Body 大小限制,值為數字,單位是 KB,支援 1~8KB 大小的 Body,值為空白的時候,預設按 8KB 生效。

1

PostBodyCacheKey

string

緩衝鍵的處理模式。

ignore

返回參數

名稱

類型

描述

樣本值

object

Schema of Response

RequestId

string

請求 ID。

36af3fcc-43d0-441c-86b1-428951dc8225

樣本

正常返回樣本

JSON格式

{
  "RequestId": "36af3fcc-43d0-441c-86b1-428951dc8225"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 CanNotSetSequence Non-regular configuration, you cannot set Sequence parameters. 全域配置中不允許設定Sequence參數。
400 CacheReserveSiteExceedLimit The number of binding sites of the cache reserve instance exceeds the limit. The number of binding sites of a single cache reserve instance is limited. Please see the document for the limit. 緩衝保持執行個體綁定的網站數量超過上限。
400 CompileRuleError Rule compilation failed, please check the rule information passed in to ensure that the rule is written according to the syntax described in the document. 規則編譯失敗,請檢查傳入的規則配置,請參考介面文檔中描述的規則配置格式。
400 SiteConfigLengthExceedLimit The overall configuration size of the site exceeds the limit, and the total size of all functional configurations of the site cannot exceed 512K. 網站功能配置大小超出限制,總大小不能超過512K。
400 ConfigConflicts Configuration conflicts, usually when multiple configurations are configured under the same function of the same site, such as duplicate rule names between multiple configurations. 參數唯一性校正失敗,請檢查重複的參數值。
400 RuleRegexQuotaCheckFailed When configuring rules, rules with regular expressions are not allowed in this plan. Please check the relevant documentation of the plan or upgrade the plan. 當前套餐不支援配置帶有正則的規則引擎,請查看套餐描述,並升級您的套餐。
400 NestedRuleQuotaCheckFailed The nesting level of rules allowed by the plan failed to be verified. Please modify the nesting level of rules or upgrade the plan. 規則內嵌子條件數量超過套餐上限,請查看套餐描述,並升級您的套餐。
400 ServiceInvokeFailed The call to the internal service failed. The engineer is resolving the problem. Please wait a moment before trying, or contact customer service for details. 調用服務失敗,請稍後重試或聯絡客服諮詢詳情。
400 FunctionConflict The feature configuration conflicts. Sites with version management enabled cannot configure this feature. 當前配置的功能與其它功能存在衝突,如需要配置請先刪除衝突的功能配置。
400 SpecifiedVersionReadOnly The specified version number is read-only and cannot be modified. 指定的版本號碼為唯讀版本, 無法修改版本配置。
400 VersionNotValid The site does not have version management enabled, or the version number passed in does not exist. 網站沒有開啟版本管理功能,或者傳入的版本號碼不存在。
400 InternalException Failed to call the service. Try again later or contact technical support. 調用服務失敗,請稍後重試或聯絡客服諮詢詳情。
400 InvalidParameter.ArgName Invalid ArgName. Check your website configuration parameters and make sure that they match the supported features and parameter names listed in the official documentation. 傳入的ArgName無效,請檢查您提供的網站配置參數,確保它們與官方文檔中列出的支援功能及參數名稱相匹配。
400 InvalidParameter.ArgValue Invalid parameter value. Check whether the value format and length meet the requirements. 參數值無效,請檢查輸入是否符合規定格式及長度限制。
400 InvalidParameter.Configs Invalid parameter configurations. Check whether your feature configurations are in the valid format and comply with relevant requirements. 配置參數錯誤,請檢查網站功能設定項是否遵循規定格式及要求。
400 InstanceNotExist The instance does not exist. Check whether the specified instance ID is correct or whether the instance belongs to your account. 執行個體不存在,請檢查提供的執行個體ID是否正確或該執行個體是否屬於您的賬戶。
400 LockFailed The system is handling requests you previously submitted. Try again later. 您有其他請求正在處理中,請稍後再進行重試。
400 IllegalOperation.VersionManagement The version management operation failed because incompatible features or environment settings are configured. Adjust your configurations and try again. 當前進行版本管理操作時,存在與其互斥的功能或環境設定,請先調整相關配置後再嘗試。
400 QuotaCheckFailed.VersionManagement Insufficient quota for version management. Contact technical support. 當前套餐的版本管理配額不足,請聯絡客服諮詢詳情。
400 InvalidConfigId The input configuration ID: ConfigId it does not exist, query the existing configuration and its valid ConfigId through the ListSiteFunction. 傳入的ConfigId不存在。
400 Instance.NotOnline Your plan is unavailable due to an overdue payment. Complete the payment first. 您的套餐執行個體因欠費當前處於非上線狀態,請先完成續約操作以繼續使用。
400 FunctionQuotaCheckFailed The quota verification for this function fails. It may be that the configuration of this function exceeds the limit of the site plan. Please check the plan introduction document corresponding to this site. 當前套餐不支援配置受限功能,請檢查套餐相關的功能描述。
400 QuotaCheckFailed.FunctionArg The specified feature parameter is not allowed in your plan, or the feature parameter configurations have reached the upper limit in your plan. 該功能參數在當前套餐中不可用,或者數量已超出配額限制。
400 MissingParameter The specified ArgName is required for this function. 配置特定功能時,缺少必傳參數。
400 FunctionArgError Failed to check the configured function parameters. 配置的功能參數檢查失敗
404 SiteNotFound The website does not exist or does not belong to you. 網站不存在,或者不屬於你。

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情