Guest User

Untitled

a guest
Oct 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2. /**
  3. * Purge varnish cache for a url.
  4. *
  5. * @param array $url_pieces
  6. * An array of pieces to look for, or regexes.
  7. */
  8. function ugc_varnish_purge_pieces(array $url_pieces) {
  9. $regex = implode('(/.*|$)', $url_pieces);
  10. ugc_varnish_purge($regex);
  11. }
  12.  
  13. function ugc_varnish_purge($regex) {
  14. _ugc_varnish_terminal_run("purge req.url ~ $regex");
  15. }
Add Comment
Please, Sign In to add comment