CorefinityCorefinityDocs
Open the Control PanelControl Panel
Varnish · 6 of 12

corestack_varnish_policy_get

Show the Varnish VCL policy.

Scope readNo secrets returned
On this page

When to use it

Read the rules custom Varnish VCL must follow before you write any, so it is accepted the first time. Then check your VCL with corestack_varnish_vcl_validate and save it with corestack_varnish_vcl_update.

Custom VCL is three snippets, each inserted into the platform's Magento VCL at a fixed point:

  • recv (vcl_recv): after purge handling, URL normalisation and every mandatory bypass (admin, customer, checkout, REST, GraphQL with Authorization, the health check); before static files and the cache lookup. It may set and unset request headers, return (pass), return (hash) and return (synth(<301–308, 403, 404, 410 or 429>, "<text>")). The request target is the platform's: req.url, Host and the method-override headers may be read in a condition but never set or unset (VN-POL-09); redirect with return (synth(301, "...")) instead.
  • backend_response (vcl_backend_response): after the platform has decided what may be cached; it may set the TTL (up to 30 days), grace (up to 3 days) and keep, set and unset response headers and turn on ESI. It can never make a private, no-store or cookie-setting response cacheable.
  • deliver (vcl_deliver): before the platform's header clean-up; it may set and unset response headers, never Set-Cookie.

Hashing, purging, backends and access control stay the platform's. The answer lists exactly what is refused (keywords, variables, functions, returns), the protected headers, the limits (16 KiB a hook, 48 KiB for the three, 200 statements a hook) and every diagnostic code (VN-POL-nn errors, VN-WARN-nn warnings, VN-LIM-nn limits) with its message.

Ask for it

Prompt
Using the Corefinity MCP server, call corestack_varnish_policy_get with site_id 4211. (Show the Varnish VCL policy.) Tell me what it returned.

Inputs

site_idintegerRequired

The row, a Magento 2 site or one of its environments. At least 1.

Example call

tools/call
{
  "name": "corestack_varnish_policy_get",
  "arguments": {
    "site_id": 4211
  }
}

If it is refused

ReasonWhat to do
varnish_not_offeredThe row is not a Magento 2 site.
invalid_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.
tenant_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it.
rate_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT