Skip to content

Commit b3115bc

Browse files
committed
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.
1 parent cb21ea7 commit b3115bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/class-wc-cache-helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static function get_cache_prefix( $group ) {
9494
$prefix = wp_cache_get( 'wc_' . $group . '_cache_prefix', $group );
9595

9696
if ( false === $prefix ) {
97-
$prefix = 1;
97+
$prefix = microtime();
9898
wp_cache_set( 'wc_' . $group . '_cache_prefix', $prefix, $group );
9999
}
100100

@@ -107,7 +107,7 @@ public static function get_cache_prefix( $group ) {
107107
* @param string $group Group of cache to clear.
108108
*/
109109
public static function incr_cache_prefix( $group ) {
110-
wp_cache_incr( 'wc_' . $group . '_cache_prefix', 1, $group );
110+
wp_cache_set( 'wc_' . $group . '_cache_prefix', microtime(), $group );
111111
}
112112

113113
/**

0 commit comments

Comments
 (0)