[wp-trac] [WordPress Trac] #31245: Replace alloptions with a key cache

WordPress Trac noreply at wordpress.org
Mon Feb 9 05:17:22 UTC 2015


#31245: Replace alloptions with a key cache
-------------------------------------+--------------------------
 Reporter:  rmccue                   |       Owner:  rmccue
     Type:  enhancement              |      Status:  assigned
 Priority:  normal                   |   Milestone:  4.2
Component:  Options, Meta APIs       |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  performance
-------------------------------------+--------------------------
Changes (by rmccue):

 * keywords:   => has-patch needs-testing


Comment:

 Added a first patch which:
 * Caches autoloaded option keys in `alloptionskeys`
 * Adds `alloptionskeys` to the protected names list
 * Sets both `alloptionskeys` and the individual option caches if
 `alloptionskeys` isn't found during load
 * Changes `add_option` and `delete_option` to add/remove keys from
 `alloptionskeys`
 * Changes `add_option`, `update_option` and `delete_option` to use
 individual cache items for each option

 This fixes #28701 in the process.

 I'm not entirely sure on the `_wp_cache_compat_get_multi` naming/usage
 pattern here, but doing it in a compatibility file requires us to either
 define the function inside `wp_start_object_cache` or in a new file after
 `wp_start_object_cache` but before `default-filters.php` is loaded.
 Thoughts?

 I'd like to get more testing in on this one too. I've tested locally with
 WP's default cache, and I have a patched version of Memcache ready to go
 too, but needs a bit more testing still.

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


More information about the wp-trac mailing list