Edge caching saves your site/page cache to Cloudflare's global network of data centers. With the edge-caching
endpoint, you can perform actions like clearing edge caching for your sites.
You can obtain the environment_id
using the GET
request with the WordPress Site Environments endpoint.
The environment_id
is also shown after the site_id
in the URL in MyKinsta when you access the environment, for example in the URL https://my.kinsta.com/sites/details/fbab4927-e354-4044-b226-29ac0fbd20ca/c84ce214-69b9-4a32-8e67-880672cf1d38?idCompany=bdd25d71-5706-4890-870f-1adda17c505d
:
site_id
is fbab4927-e354-4044-b226-29ac0fbd20ca
environment_id
is c84ce214-69b9-4a32-8e67-880672cf1d38
company_id
is bdd25d71-5706-4890-870f-1adda17c505d
Most of these edge caching endpoints will trigger longer tasks (from a few seconds to around a minute) on your environments. This is why they provide 202 Accepted
response, with an operation_id
in the body. To check the progress, you can use the /operations
endpoint.
Clearing site edge cache in progress
No or invalid API key provided to the request
Error occurred while trying to clear cache
{- "environment_id": "54fb80af-576c-4fdc-ba4f-b596c83f15a1",
- "clear_subdirectories": true,
}
{- "operation_id": "edgeCache:clear-54fb80af-576c-4fdc-ba4f-b596c83f15a1",
- "message": "Clearing site edge cache in progress",
- "status": 202
}