Advertisement
swte

Cloudways Varnish Purge Helper for Swift Performance

Sep 19th, 2018
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Plugin Name: Cloudways Varnish Purge Helper
  5.  * Plugin Description: Cloudways Varnish Purge Helper for Swift Performance
  6.  */
  7.  
  8. add_action('swift_performance_before_purge_varnish', function($url, $wildcard){
  9.     remove_all_filters('swift_performance_purge_varnish_method');
  10.     add_filter('swift_performance_purge_varnish_method', function() use($wildcard){
  11.         return $wildcard ? 'PURGE' : 'URLPURGE';
  12.     });
  13. },10,2);
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement