hosting
PUT /v1/sites/{siteId}/cache
Set a site's server-side cache times.
ప్రమాణీకరణ
బీయర్ టోకెన్గా API కీని పంపండి. కీ తప్పనిసరిగా sites.view అనుమతిని కలిగి ఉండాలి; అది లేని కీని 404 కాకుండా 403తో తిరస్కరిస్తారు.
ఈ ఎండ్పాయింట్ ఎలాంటి సంస్థ ఐడీని తీసుకోదు. మీ కీ ఇప్పటికే అది ఏ సంస్థకు చెందుతుందో గుర్తిస్తుంది మరియు ప్రతిస్పందన దానికే పరిమితం చేయబడుతుంది.
ప్రయత్నించండి
కోణీయ బ్రాకెట్లలో ఉన్న దేన్నైనా మీ స్వంత విలువలతో భర్తీ చేయండి, మరియు కీ ప్లేస్హోల్డర్ను మీ డాష్బోర్డ్ నుండి తీసుకున్న కీతో భర్తీ చేయండి.
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 కాన్సోల్ మీ అసలైన సంస్థ ID మరియు మీ స్వంత కీని నింపుతుంది, అలాగే మీరు అసలైన ప్రతిస్పందనను చూడటానికి లైవ్ 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_seconds | integer | అవును | How long stylesheets should be cached, in seconds. Zero is "do not cache". |
image_seconds | integer | అవును | How long images should be cached, in seconds. |
javascript_seconds | integer | అవును | How long scripts should be cached, in seconds. |
స్పందన
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
permitted | boolean | అవును | Whether the package type exposes cache settings and the report at all. |
purge_permitted | boolean | అవును | 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_seconds | integer | అవును | How long stylesheets are cached. |
image_seconds | integer | అవును | How long images are cached. |
javascript_seconds | integer | అవును | How long scripts are cached. |
reported | object | అవును | 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 vendor… |
report_available | boolean | అవును | 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… |
report | SiteCacheReportRow[] | అవును | What the platform did with the URLs it has seen. |
ఈ ఎండ్పాయింట్ తిరిగి ఇవ్వగల లోపాలు
401 · 403 · 404 · 422 · 429 · 503