[wp-trac] [WordPress Trac] #58277: Change the position of notoptions lookup in get_option

WordPress Trac noreply at wordpress.org
Wed Jan 15 22:11:31 UTC 2025


#58277: Change the position of notoptions lookup in get_option
--------------------------------------+---------------------------
 Reporter:  spacedmonkey              |       Owner:  spacedmonkey
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.4
Component:  Options, Meta APIs        |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note  |     Focuses:  performance
--------------------------------------+---------------------------

Comment (by peterwilsoncc):

 In [changeset:"59631" 59631]:
 {{{
 #!CommitTicketReference repository="" revision="59631"
 Options/Meta APIs: Optimize cache hits for non-existent options.

 Optimize the order of checking the various options caches in
 `get_option()` to prevent hitting external caches each time it is called
 for a known non-existent option.

 The caches are checked in the following order when getting an option:

 1. Check the `alloptions` cache first to prioritize existing loaded
 options.
 2. Check the `notoptions` cache before a cache lookup or DB hit.
 3. Check the `options` cache prior to a DB hit.

 Follow up to [56595].

 Props adamsilverstein, flixos90, ivankristianto, joemcgill, rmccue,
 siliconforks, spacedmonkey.
 Fixes #62692.
 See #58277.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58277#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list