Last active
December 14, 2016 10:10
-
-
Save fliphess/8280d627b73fc111e2d2 to your computer and use it in GitHub Desktop.
byte flush varnish when on a varnish cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1 | |
$domains = array('devguppie.com', 'wwww.devguppie.com', 'www.example.com', 'example.com'); | |
foreach ($domains as $domain) { | |
$curl = curl_init("http://$domain/.*"); | |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE"); | |
curl_exec($curl); | |
curl_close($curl); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1 | |
$domain = basename(dirname(realpath(__FILE__))); | |
$curl = curl_init("http://$domain/.*"); | |
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PURGE"); | |
curl_exec($curl); | |
curl_close($curl); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment