Changed caching invalidation by using increment to using microtime.

This is a similar problem that WP core faced in https://core.trac.wordpress.org/ticket/23448.
This commit is contained in:
Peter Fabian 2019-11-03 14:14:53 +01:00
parent cb21ea7a3d
commit b3115bccc5
1 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ class WC_Cache_Helper {
$prefix = wp_cache_get( 'wc_' . $group . '_cache_prefix', $group );
if ( false === $prefix ) {
$prefix = 1;
$prefix = microtime();
wp_cache_set( 'wc_' . $group . '_cache_prefix', $prefix, $group );
}
@ -107,7 +107,7 @@ class WC_Cache_Helper {
* @param string $group Group of cache to clear.
*/
public static function incr_cache_prefix( $group ) {
wp_cache_incr( 'wc_' . $group . '_cache_prefix', 1, $group );
wp_cache_set( 'wc_' . $group . '_cache_prefix', microtime(), $group );
}
/**