WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#15452 closed enhancement (fixed)

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

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

Description

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)

comment:1 scribu3 years ago

Related: #14817

comment:2 ryan3 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.