CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 8 of 19

Get a site's Varnish statistics

Answers the cache's figures over the last hour, day or week, in equal steps: hits, misses, requests, the hit ratio, cached pages and memory, with the totals and the recent purges. available is false, with a reason, until the site has been sampled.

GET/api/corestack/sites/{site}/varnish/stats

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.

Query parameters

rangestring

How far back.

1h24h7d

Returns

200 The statistics. buckets is shortened here.

Fields of the 200 answer
availablebooleanRequired
bucket_secondsintegerRequired

The length of one step.

bucketsarray of objectsRequired

One entry a step. A figure is null where there was no sample.

Fields of each item
atstringRequired

Format: date-time.

backend_errorsinteger or null
backend_fetchesinteger or null
bytes_freeinteger or null
bytes_usedinteger or null
evictionsinteger or null
hit_rationumber or null
hitsinteger or null
missesinteger or null
objectsinteger or null

Cached pages.

passesinteger or null
requestsinteger or null
requests_per_snumber or null
resetboolean

True where the counters started again, for example after a version change.

samplesinteger
storage_bytesinteger or null
transient_bytesinteger or null
fromstringRequired
hostsarray of strings

The site's hostnames.

purges_this_hourobject
Fields
available_atstring or null

Format: date-time.

limitinteger
usedinteger
rangestringRequired
1h24h7d
reasonstring or null

Why there are no figures, such as sampler_pending before the first sample.

recent_purgesarray of objects

The latest purges, newest first.

Fields of each item
atstring or nullRequired

Format: date-time.

byobject or any or null

The person who asked, by name. Null for a purge nobody asked for, or when the account no longer exists.

confirmedboolean or null
hostsarray of stringsRequired
idintegerRequired

At least 1.

item_countintegerRequired
itemsarray of stringsRequired
modestringRequired
referenceinteger or null

What the trigger refers to, when it names something. For a deployment, its id.

sourcestringRequired

Who or what asked: a person, a deployment, or the platform by itself (automatic).

persondeploymentautomatic
statusstringRequired
triggerstring or null

What set off a purge nobody asked for, such as deployment, go_live or enable. Null for a person's.

viastring or null

Where a person asked. Null for a purge nobody asked for.

panelapimcpnull
sampled_atstring or null

Format: date-time.

staleboolean

True when the latest sample is old.

tostringRequired
totalsobjectRequired

The same figures over the whole range. A figure is null while there are no samples for it; missing names those.

Fields
backend_errorsnumber or nullRequired
backend_fetchesnumber or nullRequired
bytes_freenumber or nullRequired
bytes_usednumber or nullRequired
evictionsnumber or nullRequired
hit_rationumber or nullRequired
hit_ratio_7dnumber or nullRequired
hitsnumber or nullRequired
missesnumber or nullRequired
missingarray of stringsRequired
objectsnumber or nullRequired
pass_rationumber or nullRequired
passesnumber or nullRequired
peak_requests_per_snumber or nullRequired
requestsnumber or nullRequired
requests_per_snumber or nullRequired
resetsintegerRequired

How many times the counters started again in the range.

storage_bytesnumber or nullRequired
transient_bytesnumber or nullRequired

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.
409varnish_not_offeredVarnish is available for Magento 2 sites only. Nothing to change here.
409varnish_offVarnish is off on the environment. Switch it on first.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl https://manage.corefinity.com/api/corestack/sites/1042/varnish/stats \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
{
  "available": true,
  "bucket_seconds": 3600,
  "buckets": [
    {
      "at": "2026-11-06T08:00:00Z",
      "backend_errors": 0,
      "backend_fetches": 840,
      "bytes_free": 402653184,
      "bytes_used": 268435456,
      "evictions": 0,
      "hit_ratio": 0.9,
      "hits": 5400,
      "misses": 600,
      "objects": 4200,
      "passes": 240,
      "requests": 6240,
      "requests_per_s": 1.73,
      "reset": false,
      "samples": 12,
      "storage_bytes": 671088640,
      "transient_bytes": 1048576
    }
  ],
  "from": "2026-11-05T09:00:00Z",
  "hosts": [
    "harbourandfinch.example.com",
    "www.harbourandfinch.example.com"
  ],
  "purges_this_hour": {
    "available_at": null,
    "limit": 10,
    "used": 1
  },
  "range": "24h",
  "reason": null,
  "recent_purges": [
    {
      "at": "2026-11-06T09:16:40Z",
      "by": {
        "name": "Eleanor Finch"
      },
      "confirmed": true,
      "hosts": [],
      "id": 905,
      "item_count": 2,
      "items": [
        "cat_p_1180",
        "cat_c_27"
      ],
      "mode": "tags",
      "reference": null,
      "source": "person",
      "status": "succeeded",
      "trigger": null,
      "via": "api"
    },
    {
      "at": "2026-11-06T08:41:07Z",
      "by": null,
      "confirmed": true,
      "hosts": [],
      "id": 902,
      "item_count": 0,
      "items": [],
      "mode": "all",
      "reference": 4821,
      "source": "deployment",
      "status": "succeeded",
      "trigger": "deployment",
      "via": null
    }
  ],
  "sampled_at": "2026-11-06T08:55:00Z",
  "stale": false,
  "to": "2026-11-06T09:00:00Z",
  "totals": {
    "backend_errors": 0,
    "backend_fetches": 20160,
    "bytes_free": 402653184,
    "bytes_used": 268435456,
    "evictions": 0,
    "hit_ratio": 0.9,
    "hit_ratio_7d": 0.88,
    "hits": 129600,
    "misses": 14400,
    "missing": [],
    "objects": 4200,
    "pass_ratio": 0.04,
    "passes": 5760,
    "peak_requests_per_s": 6.2,
    "requests": 149760,
    "requests_per_s": 1.73,
    "resets": 0,
    "storage_bytes": 671088640,
    "transient_bytes": 1048576
  }
}
Try it
Held in this tab's memory only. Never stored or sent to us.

Use a token with only the read scope. How to make one

Was this helpful?
Open in ClaudeOpen in ChatGPT