corestack_ varnish_ policy_ get
Show the Varnish VCL policy.
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)andreturn (synth(<301–308,. The request target is the platform's:403, 404, 410 or 429>, "<text>")) req.url,Hostand the method-override headers may be read in a condition but never set or unset (VN-POL-09); redirect withreturn (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, neverSet-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
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
{
"name": "corestack_varnish_policy_get",
"arguments": {
"site_id": 4211
}
}If it is refused
| Reason | What to do |
|---|---|
varnish_not_offered | The row is not a Magento 2 site. |
invalid_arguments | The 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_mismatch | The object does not exist or the token may not see it. Check the id. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
pin_refused | The 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_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something went wrong on our side. Quote the trace id to support. |
The same task elsewhere
Was this helpful?