PluginProbe
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization / 4.2.15
Optimole – Optimize Images | Convert WebP & AVIF | CDN & Lazy Load | Image Optimization v4.2.15
4.2.15 4.2.14 4.2.13 4.2.12 4.2.11 4.2.10 4.2.9 4.2.8 4.2.7 4.2.6 4.2.5 2.5.5 2.5.6 2.5.7 3.0.0 3.0.1 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.11.0 3.11.1 3.11.2 3.11.3 All 136 releases
← All changes | inc/attachment_cache.php +6 -2 3.11.1 → 4.2.15 View file →
@@ -10,10 +10,15 @@
10 10 *
11 11 * @var array
12 12 */
13 13 private static $cache_map = [];
14 -
15 14 /**
15 + * Reset the memory cache.
16 + */
17 + public static function reset() {
18 + self::$cache_map = [];
19 + }
20 + /**
16 21 * Get the cached attachment ID.
17 22 *
18 23 * @param string $url the URL of the attachment.
19 24 *
@@ -53,9 +58,8 @@
53 58 $expiration = $id === 0 ? ( 10 * MINUTE_IN_SECONDS ) : WEEK_IN_SECONDS;
54 59 wp_using_ext_object_cache()
55 60 ? wp_cache_set( $cache_key, $id, self::CACHE_GROUP, $expiration )
56 61 : set_transient( self::CACHE_GROUP . $cache_key, $id, $expiration );
57 -
58 62 }
59 63
60 64 /**
61 65 * Generate cache key for URL.