[wp-trac] [WordPress Trac] #23330: Allow autoloading all options, not just autoload = yes options

WordPress Trac noreply at wordpress.org
Wed Jan 30 21:12:58 UTC 2013


#23330: Allow autoloading all options, not just autoload = yes options
----------------------------+--------------------------
 Reporter:  ryan            |       Type:  defect (bug)
   Status:  new             |   Priority:  normal
Milestone:  Future Release  |  Component:  Cache
  Version:  3.5.1           |   Severity:  normal
 Keywords:                  |
----------------------------+--------------------------
 For 5 years on wordpress.com we have ignore 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23330>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list