WordPress.org

Make WordPress Core

Opened 15 months ago

Last modified 2 months ago

#23330 new defect (bug)

Allow autoloading all options, not just autoload = yes options — at Version 1

Reported by: ryan Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 3.5.1
Component: Cache API Keywords: needs-patch
Focuses: Cc:

Description (last modified by ryan)

For 5 years on wordpress.com we have ignored the autoload field for options. In wp_load_alloptions(), autoload = yes is not part of the query. Why? Because wordpress.com has a persistent cache. Thus, the transients that constitute the bulk of autoload = no options are stored in cache, never in the options table. Querying autoload=yes makes the query slower for no reason.

Having autoload = no options also complicates notoptions caching. Core has a notoptions cache that would be unnecessary if you can assume that wp_load_alloptions() loads every option. If an option is not in alloptions, then it does not exist.

Other large sites that use a persistent cache might also like to ignore the autoload flag. Core could automatically switch to ignoring autoload when an external object cache is being used, but administrators might want to control this so they can clean out old transients from options tables and do whatever other housekeeping is desired. So, let's add a filter that allows toggling this. When autoload is being ignored the wp_load_alloptions() query does not include autoload=yes and notoptions is not used.

Change History (1)

comment:1 ryan15 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.