All Products
Search
Document Center

Edge Security Acceleration:UpdateCacheRule

Last Updated:Jun 11, 2026

Ubah konfigurasi cache.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

esa:UpdateCacheRule

update

*Site

acs:esa:{#regionId}:{#accountId}:site/{#SiteId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

SiteId

integer

Yes

ID situs. Untuk mendapatkan ID ini, panggil operasi ListSites.

123456****

ConfigId

integer

Yes

ID konfigurasi.

35281609698****

RuleName

string

No

Nama aturan. Parameter ini opsional untuk konfigurasi global.

rule_example

RuleEnable

string

No

Mengontrol apakah aturan diaktifkan. Parameter ini opsional untuk konfigurasi global. Nilai yang valid:

  • on: Mengaktifkan aturan.

  • off: Menonaktifkan aturan.

on

Rule

string

No

Ekspresi kondisional yang cocok dengan permintaan pengguna. Parameter ini opsional untuk konfigurasi global. Dua skenario didukung:

  • Untuk mencocokkan semua permintaan yang masuk, atur nilainya ke true.

  • Untuk mencocokkan permintaan tertentu, atur nilainya ke ekspresi kustom, misalnya, (http.host eq "video.example.com").

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

BypassCache

string

No

Mode bypass cache. Nilai yang valid:

  • cache_all: Meng-cache semua permintaan.

  • bypass_all: Melewati cache untuk semua permintaan.

cache_all

BrowserCacheMode

string

No

Mode cache browser. Nilai yang valid:

  • no_cache: Tidak meng-cache konten di browser.

  • follow_origin: Mengikuti kebijakan caching server asal.

  • override_origin: Menimpa kebijakan caching server asal.

no_cache

BrowserCacheTtl

string

No

TTL (Time to Live) cache browser, dalam detik.

300

EdgeCacheMode

string

No

Mode cache untuk node edge. Nilai yang valid:

  • follow_origin: Mengikuti kebijakan caching server asal. Jika server asal tidak memiliki kebijakan, kebijakan default digunakan.

  • no_cache: Tidak meng-cache konten.

  • override_origin: Menimpa kebijakan caching server asal.

  • follow_origin_bypass: Mengikuti kebijakan caching server asal, jika ada. Jika tidak, konten tidak di-cache.

  • follow_origin_override: Mengikuti kebijakan caching server asal, jika ada. Jika tidak, TTL cache kustom digunakan.

follow_origin

EdgeCacheTtl

string

No

TTL (Time to Live) cache node edge, dalam detik.

300

EdgeStatusCodeCacheTtl

string

No

TTL cache untuk kode status tertentu, dalam detik.

  • Anda dapat mengatur TTL cache untuk kode status tertentu. Misalnya, 404=10 meng-cache respons dengan kode status 404 selama 10 detik.

  • Anda dapat mengatur TTL cache untuk rentang kode status 4xx dan 5xx. Misalnya, 4xx=10 meng-cache semua respons dengan kode status 4xx selama 10 detik.

  • Pisahkan beberapa pengaturan kode status dengan koma.

5xx=0,404=10

SortQueryStringForCache

string

No

Mengontrol apakah parameter query string diurutkan saat menghasilkan kunci cache. Nilai yang valid:

  • on: Mengaktifkan pengurutan.

  • off: Menonaktifkan pengurutan.

on

QueryStringMode

string

No

Mengontrol bagaimana query string digunakan untuk menghasilkan kunci cache. Nilai yang valid:

  • ignore_all: Mengabaikan semua query string.

  • exclude_query_string: Menghapus query string yang ditentukan.

  • reserve_all: Mempertahankan semua query string. Ini adalah nilai default.

  • include_query_string: Mempertahankan hanya query string yang ditentukan.

ignore_all

QueryString

string

No

Parameter query string untuk disertakan dalam atau dikecualikan dari kunci cache. Pisahkan beberapa parameter dengan spasi.

example1 example2

IncludeHeader

string

No

Header yang disertakan dalam kunci cache. Baik nama header (tidak peka huruf besar/kecil) maupun nilainya digunakan. Pisahkan beberapa header dengan spasi. Nama header dapat berisi karakter berikut:

  • Simbol: ! # $ % & ' * + - . ^ _ | ~

  • Digit: 0-9

  • Huruf kecil: a-z

headername1 headername2

IncludeCookie

string

No

Cookie yang disertakan dalam kunci cache. Baik nama cookie (tidak peka huruf besar/kecil) maupun nilainya digunakan. Pisahkan beberapa cookie dengan spasi. Nama cookie dapat berisi karakter berikut:

  • Simbol: ! # $ % & ' * + - . ^ _ | ~

  • Digit: 0-9

  • Huruf kecil: a-z

cookiename1 cookiename2

CacheReserveEligibility

string

No

Mengontrol apakah permintaan melewati node cache reserve selama origin-pull. Nilai yang valid:

  • bypass_cache_reserve: Permintaan melewati cache reserve.

  • eligible_for_cache_reserve: Permintaan memenuhi syarat untuk cache reserve.

bypass_cache_reserve

CheckPresenceHeader

string

No

Header yang akan diperiksa. Jika header yang ditentukan ada dalam permintaan, namanya (tidak peka huruf besar/kecil) ditambahkan ke kunci cache. Pisahkan beberapa header dengan spasi. Nama header dapat berisi karakter berikut:

  • Simbol: ! # $ % & ' * + - . ^ _ | ~

  • Digit: 0-9

  • Huruf kecil: a-z

headername1 headername2

CheckPresenceCookie

string

No

Cookie yang akan diperiksa. Jika cookie yang ditentukan ada dalam permintaan, namanya (tidak peka huruf besar/kecil) ditambahkan ke kunci cache. Pisahkan beberapa cookie dengan spasi. Nama cookie dapat berisi karakter berikut:

  • Simbol: ! # $ % & ' * + - . ^ _ | ~

  • Digit: 0-9

  • Huruf kecil: a-z

cookiename1 cookiename2

UserDeviceType

string

No

Mengontrol apakah jenis perangkat klien disertakan dalam kunci cache. Nilai yang valid:

  • on: Mengaktifkan fitur ini.

  • off: Menonaktifkan fitur ini.

on

UserGeo

string

No

Mengontrol apakah lokasi geografis klien disertakan dalam kunci cache. Nilai yang valid:

  • on: Mengaktifkan fitur ini.

  • off: Menonaktifkan fitur ini.

on

UserLanguage

string

No

Mengontrol apakah bahasa klien disertakan dalam kunci cache. Nilai yang valid:

  • on: Mengaktifkan fitur ini.

  • off: Menonaktifkan fitur ini.

on

ServeStale

string

No

Mengontrol apakah konten basi (stale) disajikan. Jika diaktifkan, node edge dapat menyajikan konten kedaluwarsa dari cache-nya jika server asal tidak tersedia. Nilai yang valid:

  • on: Mengaktifkan fitur ini.

  • off: Menonaktifkan fitur ini.

on

AdditionalCacheablePorts

string

No

  • Mengaktifkan caching pada port yang ditentukan.

  • Nilai yang valid: 8880, 2052, 2082, 2086, 2095, 2053, 2083, 2087, 2096

  • Pisahkan beberapa port dengan koma.

8880,2052,2086

CacheDeceptionArmor

string

No

Bertahan terhadap serangan Web Cache Deception dengan hanya meng-cache konten yang divalidasi. Nilai yang valid:

  • on: Mengaktifkan fitur.

  • off: Menonaktifkan fitur.

on

Sequence

integer

No

Prioritas eksekusi aturan. Nilai yang lebih kecil menunjukkan prioritas yang lebih tinggi.

1

PostCache

string

No

Mengontrol apakah respons terhadap permintaan POST di-cache.

on

PostBodySizeLimit

string

No

Ukuran maksimum body permintaan untuk caching POST, dalam KB. Nilainya harus bilangan bulat dari 1 hingga 8. Jika Anda mengosongkan parameter ini, nilai default 8 KB digunakan.

1

PostBodyCacheKey

string

No

Mengontrol bagaimana body permintaan digunakan untuk menghasilkan kunci cache untuk permintaan POST. Nilai yang valid:

  • md5: Menghitung hash MD5 dari body permintaan dan menyertakan hash dalam kunci cache.

  • ignore: Mengabaikan body permintaan saat menghasilkan kunci cache.

ignore

Elemen respons

Element

Type

Description

Example

object

Data respons.

RequestId

string

ID permintaan.

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

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 CanNotSetSequence Non-regular configuration, you cannot set Sequence parameters.
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.
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.
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.
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.
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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.