Invalidate cache for SiteGround Speed Optimizer when coming soon options are changed (#48523)

* chore: Invalidate cache for SiteGround Speed Optimizer and WP Engine

The code changes in `ComingSoonCacheInvalidator.php` add cache invalidation for SiteGround Speed Optimizer and WP Engine. This ensures that the cache is cleared when necessary, improving the performance of the website.

* Add changelog

* Add a slash to ensure calls are made in global namespace

* Use sg_cachepress_purge_cache

* Update plugins/woocommerce/src/Internal/ComingSoon/ComingSoonCacheInvalidator.php

Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>

* Fix lint

* Update plugins/woocommerce/changelog/update-purge-cache-siteground-wpengine

---------

Co-authored-by: Adrian Duffell <9312929+adrianduffell@users.noreply.github.com>
Co-authored-by: moon <moon.kyong@automattic.com>
This commit is contained in:
Chi-Hsuan Huang 2024-06-19 09:19:33 +08:00 committed by GitHub
parent 0e1ae1717d
commit 1dd10f6269
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Invalidate cache for SiteGround Speed Optimizer

View File

@ -39,5 +39,10 @@ class ComingSoonCacheInvalidator {
)
);
}
// Invalidate the SiteGround Speed Optimizer cache.
if ( function_exists( '\sg_cachepress_purge_cache' ) ) {
\sg_cachepress_purge_cache();
}
}
}