Skip to content

Instantly share code, notes, and snippets.

@mshmsh5000
Created November 13, 2013 15:10
Show Gist options
  • Select an option

  • Save mshmsh5000/7450623 to your computer and use it in GitHub Desktop.

Select an option

Save mshmsh5000/7450623 to your computer and use it in GitHub Desktop.
Clear Varnish from your browser console. Varnish must be configured to accept PURGE HTTP requests, you must be on the ACL if it exists, etc.
var xmlHttp=new XMLHttpRequest();
xmlHttp.open('PURGE', top.location.href, true);
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState === 4) {
if (xmlHttp.status === 200) {
console.log("Great");
}
else {
console.log("Too bad");
}
}
};
xmlHttp.send(null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment