-
Notifications
You must be signed in to change notification settings - Fork 2
Description
The WPEngine integration appears to clear the page's varnish cache on each hit to a /nocache/ link, using the wp_criticalcss_nocache action. This was added in 69c7926
Since the Web Check Queue hits the /nocache/ links, isn't the varnish cache being cleared every time the web check is done, regardless of whether there's page change to pass to the API Queue?
Would it be beneficial to instead duplicate the modify_permalink() function from the Kinsta integration, and add a cache_bust query argument?
wp-criticalcss/lib/WP/CriticalCSS/Integration/Kinsta.php
Lines 29 to 32 in 1de13ff
| if ( wp_doing_cron() ) { | |
| add_filter( 'wp_criticalcss_get_permalink', [ $this, 'modify_permalink' ] ); | |
| } | |
| } |
wp-criticalcss/lib/WP/CriticalCSS/Integration/Kinsta.php
Lines 41 to 45 in 1de13ff
| public function modify_permalink( $url ) { | |
| $key = 'cache_bust_' . bin2hex( random_bytes( 5 ) ); | |
| return add_query_arg( $key, '1', $url ); | |
| } |
Apologies if I'm missing the purpose of the cache clear.