Skip to content

WPEngine integration clears varnish cache on each /nocache/ hit #11

@fluxism

Description

@fluxism

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?

if ( wp_doing_cron() ) {
add_filter( 'wp_criticalcss_get_permalink', [ $this, 'modify_permalink' ] );
}
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions