Varnish Cache Purging with cURL PHP vs. Command Line cURL Varnish Cache Purging with cURL PHP vs. Command Line cURL curl curl

Varnish Cache Purging with cURL PHP vs. Command Line cURL


You're not issuing the correct "Host: " HTTP header, so I assume there is a problem with one of the following lines:

$varnishhost = 'Host: ' . $_SERVER['SERVER_NAME'];curl_setopt($curl, CURLOPT_ENCODING, $varnishhost);