hosting

PUT /v1/sites/{siteId}/cache

Set a site's server-side cache times.

ចំណុចបញ្ចប់ hosting ទាំងអស់

ការផ្ទៀងផ្ទាត់ភាពត្រឹមត្រូវ

បញ្ជូនសោ API ជា bearer token។ សោនេះត្រូវតែមានសិទ្ធិ sites.view។ សោដែលគ្មានសិទ្ធិនេះនឹងត្រូវបដិសេធដោយកូដ 403 មិនមែន 404 ទេ។

ចំនុចបញ្ចប់នេះមិនត្រូវការលេខសម្គាល់ស្ថាប័នទេ។ ពស័្ដកូនរបស់អ្នករួចហើយកំណត់អត្តសញ្ញាណស្ថាប័នដែលវាជាកម្មសិទ្ធិ ហើយការឆ្លើយតបគឺត្រូវបានកំណត់វិសាលភាពទៅតាមនោះ។

សាកល្បង

ជំនួសអ្វីមួយនៅក្នុងសញ្ញាពងក្រពើ < > ដោយប្រើតម្លៃផ្ទាល់ខ្លួនរបស់អ្នក ហើយជំនួសកន្លែងរក្សាទុកសោដោយប្រើសោចេញពីផ្ទាំងគ្រប់គ្រងរបស់អ្នក។

curl -X PUT https://api.zinndigital.com/v1/sites/{siteId}/cache \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "css_seconds": <integer>, "image_seconds": <integer>, "javascript_seconds": <integer> }'

បានចូលគណនីរួចហើយមែនទេ? កុងសូល API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក បំពេញលេខសម្គាល់ស្ថាប័នពិតប្រាកដរបស់អ្នក និងសោផ្ទាល់ខ្លួនរបស់អ្នក ហើយដំណើរការសំណើទល់នឹង API ផ្ទាល់ ដូច្នេះអ្នកអាចមើលឃើញការឆ្លើយតបពិតប្រាកដ។ បើកចំណុចបញ្ចប់នេះក្នុងកុងសូល API

ព័ត៌មានលម្អិត

Writes the three cache times a package lets a customer change, and returns the whole cache state so the card re-renders from the server's answer rather than from what it asked for. `PUT` because the body states the desired end state. ⛔⛔ **All three classes are required, every time, and that is the contract rather than an oversight.** The vendor replaces the stored policy with exactly the body it is given, so a request naming two classes **deletes the third** — silently, with a cheerful acknowledgement. Making the fields optional would put that footgun on the wire where every future client would find it. A value outside 0…31536000 seconds is refused `422` before the vendor is called, as is a package type whose cache settings it does not permit. `404` for a site with no vendor hosting package, or one that is not the caller's. Requires `sites.view` **and** `sites.panel_access`.

ប៉ារ៉ាម៉ែត្រ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
siteId (path)Uuidបាទ/ចាសSite ID (UUIDv7).

សំណើរបស់រាងកាយ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
css_secondsintegerបាទ/ចាសHow long stylesheets should be cached, in seconds. Zero is "do not cache".
image_secondsintegerបាទ/ចាសHow long images should be cached, in seconds.
javascript_secondsintegerបាទ/ចាសHow long scripts should be cached, in seconds.

ផ្អាកដំណើរការ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
permittedbooleanបាទ/ចាសWhether the package type exposes cache settings and the report at all.
purge_permittedbooleanបាទ/ចាសWhether a purge is permitted. Separate from `permitted` on purpose: the purge was measured working on a package whose cache settings and report the vendor refuses.
css_secondsintegerបាទ/ចាសHow long stylesheets are cached.
image_secondsintegerបាទ/ចាសHow long images are cached.
javascript_secondsintegerបាទ/ចាសHow long scripts are cached.
reportedobjectបាទ/ចាសEvery asset class the vendor reported, keyed by its own name, including the classes that cannot be written. ⛔ Read-only on a client: writing them deletes them, because the vendo…
report_availablebooleanបាទ/ចាសWhether the cacheability report could be read. False renders an explanation rather than an empty table, so "nothing has been seen yet" and "not part of this plan" never look ide…
reportSiteCacheReportRow[]បាទ/ចាសWhat the platform did with the URLs it has seen.

កំហុសដែលចំណុចបញ្ចប់នេះអាចបង្វិលត្រឡប់មកវិញ

401 · 403 · 404 · 422 · 429 · 503