Skip to content

Instantly share code, notes, and snippets.

@diogoca
Forked from ismasan/purge.vcl
Created January 2, 2014 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogoca/8219516 to your computer and use it in GitHub Desktop.
Save diogoca/8219516 to your computer and use it in GitHub Desktop.
# This goes in vcl_recv
# It gives you:
# curl -X PURGE http://some.example.com/.*
# curl -X PURGE http://some.example.com/blog/.*
# curl -X PURGE http://some.example.com/blog/2011/bar.html
# curl -X PURGE http://another.example.com/.*
#
if (req.request == "PURGE") {
# Wildcard, per-domain purging
purge("req.http.host == " req.http.host " && req.url ~ " req.url "$");
error 200 "Purged.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment