CorefinityCorefinityDocs
Open the Control PanelControl Panel
Node.js · 6 of 7

Clear a site's package caches

Clears the package caches named in which, or all four when it is left out, and answers the bytes each freed. Global packages and projects are untouched.

POST/api/corestack/sites/{site}/node-runtime/caches/clear

Path parameters

siteintegerRequired

The id of a site row. A website's production site and each of its environments has its own id. Digits only. At least 1.

Body

whicharray of strings

The caches to clear, each once. Left out, all four are cleared.

npmcorepackpnpmyarn

Returns

200 The bytes each cache freed. A cache that was not cleared reads 0.

Fields of the 200 answer
clearedobjectRequired
Fields
corepack_bytesintegerRequired
npm_bytesintegerRequired
pnpm_bytesintegerRequired
yarn_bytesintegerRequired

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404feature_offThis feature is not on for your organisation yet.
409busyAnother operation is running on the site. Wait for it to finish.
409not_runningThe site, environment or deployment is not running. Read the message: where it can be started or will recover, start it or wait, then try again.
422invalid_argumentsThe arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again.
429rate_limitedWait for the seconds in Retry-After.
502node_check_failedThe package check answered something the control panel cannot read.
503connect_failedThe cluster could not be reached.
503temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
503switched_offCorefinity has switched this action off for the moment. Try again later.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/node-runtime/caches/clear \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{}'
{
  "cleared": {
    "corepack_bytes": 0,
    "npm_bytes": 301989888,
    "pnpm_bytes": 0,
    "yarn_bytes": 14680064
  }
}
Try it

Try it is off for this endpointIt deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT