diff --git a/inc/Addon/Varnish/Subscriber.php b/inc/Addon/Varnish/Subscriber.php index 6b1e9fa1d8..fe5adbf213 100644 --- a/inc/Addon/Varnish/Subscriber.php +++ b/inc/Addon/Varnish/Subscriber.php @@ -40,11 +40,12 @@ public function __construct( Varnish $varnish, Options_Data $options ) { */ public static function get_subscribed_events() { return [ - 'before_rocket_clean_domain' => [ 'clean_domain', 10, 3 ], - 'before_rocket_clean_file' => [ 'clean_file' ], - 'rocket_rucss_after_clearing_usedcss' => [ 'clean_file' ], - 'before_rocket_clean_home' => [ 'clean_home', 10, 2 ], - 'rocket_saas_complete_job_status' => [ 'clean_file' ], + 'before_rocket_clean_domain' => [ 'clean_domain', 10, 3 ], + 'before_rocket_clean_file' => [ 'clean_file' ], + 'rocket_rucss_after_clearing_usedcss' => [ 'clean_file' ], + 'rocket_performance_hints_data_after_clearing' => [ 'clean_file' ], + 'before_rocket_clean_home' => [ 'clean_home', 10, 2 ], + 'rocket_saas_complete_job_status' => [ 'clean_file' ], ]; } diff --git a/tests/Fixtures/inc/Addon/Varnish/Subscriber/cleanFile.php b/tests/Fixtures/inc/Addon/Varnish/Subscriber/cleanFile.php index 8c32b2382f..aae721a1be 100644 --- a/tests/Fixtures/inc/Addon/Varnish/Subscriber/cleanFile.php +++ b/tests/Fixtures/inc/Addon/Varnish/Subscriber/cleanFile.php @@ -54,4 +54,22 @@ ], 'expected' => true, ], + 'testRocketPerformanceHintDataShouldPurgeOnceWhenVarnishEnabled' => [ + 'config' => [ + 'filter' => false, + 'hook' => 'rocket_performance_hints_data_after_clearing', + 'arg' => 'http://example.org/about/', + 'option' => 1, + ], + 'expected' => true, + ], + 'testRocketPerformanceHintDataShouldPurgeOnceWhenFilterEnabled' => [ + 'config' => [ + 'filter' => true, + 'hook' => 'rocket_performance_hints_data_after_clearing', + 'arg' => 'http://example.org/about/', + 'option' => 0, + ], + 'expected' => true, + ] ];