hosting

PUT /v1/sites/{siteId}/cache

Set a site's server-side cache times.

Lahat ng hosting endpoint

Pagpapatotoo

Magpadala ng API key bilang isang bearer token. Kailangang taglayin ng key ang pahintulot na sites.view; ang key na wala nito ay tatanggihan gamit ang 403, hindi 404.

Ang endpoint na ito ay hindi nangangailangan ng id ng organisasyon. Natutukoy na ng iyong key ang organisasyong kinabibilangan nito, at nakatuon ang tugon dito.

Subukan ito

Palitan ang anuman sa loob ng mga panaklong na may anggulo ng iyong sariling mga halaga, at ang placeholder ng key na may key mula sa iyong dashboard.

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> }'

Nakalagda? Ang API console sa iyong dashboard ay awtomatikong naglalagay ng iyong tunay na ID ng organisasyon at sariling susi, at pinapatakbo ang kahilingan laban sa live na API upang makita mo ang aktwal na tugon. Buksan ang endpoint na ito sa console ng API

Mga Detalye

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`.

Mga Parameter

PangalanUriKailanganAno ito
siteId (path)UuidOoSite ID (UUIDv7).

Katawan ng kahilingan

PangalanUriKailanganAno ito
css_secondsintegerOoHow long stylesheets should be cached, in seconds. Zero is "do not cache".
image_secondsintegerOoHow long images should be cached, in seconds.
javascript_secondsintegerOoHow long scripts should be cached, in seconds.

Tugon

PangalanUriKailanganAno ito
permittedbooleanOoWhether the package type exposes cache settings and the report at all.
purge_permittedbooleanOoWhether 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_secondsintegerOoHow long stylesheets are cached.
image_secondsintegerOoHow long images are cached.
javascript_secondsintegerOoHow long scripts are cached.
reportedobjectOoEvery 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_availablebooleanOoWhether 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[]OoWhat the platform did with the URLs it has seen.

Mga error na maibabalik ng endpoint na ito

401 · 403 · 404 · 422 · 429 · 503