Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#15452 closed enhancement (fixed)

Use wp_cache_add() instead of wp_cache_set() in update_meta_cache()

Reported by: ryan's profile ryan Owned by:
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.0.1
Component: Cache API Keywords:
Focuses: Cc:


update_meta_cache() already does a wp_cache_get() on each object_id and excludes those that are already in the cache from further processing. Later on it does a wp_cache_set(). This can be a wp_cache_add() instead. Using adds is preferred policy when priming the cache (as opposed to updating the cache when something is changed, which should use set) and can improve cache performance in certain scenarios since an add does not force invalidation.

Change History (2)

#1 @scribu
13 years ago

Related: #14817

#2 @ryan
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [16437]) Use wp_cache_add() instead of wp_cache_set() in update_meta_cache(). fixes #15452

Note: See TracTickets for help on using tickets.