Skip to content

Commit

Permalink
Fixes #6885 Hosting cache not cleared when clearing Performance Hints…
Browse files Browse the repository at this point in the history
… for current URL (PR #6921)

Co-authored-by: WordPressFan
  • Loading branch information
Khadreal authored Aug 30, 2024
1 parent 7150c17 commit 88bfea5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
11 changes: 6 additions & 5 deletions inc/Addon/Varnish/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ],
];
}

Expand Down
18 changes: 18 additions & 0 deletions tests/Fixtures/inc/Addon/Varnish/Subscriber/cleanFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]
];

0 comments on commit 88bfea5

Please sign in to comment.