[wp-trac] [WordPress Trac] #27935: Multisite get_site_option() does not cache empty string values in "SITE_ID:notoptions"

WordPress Trac noreply at wordpress.org
Thu Dec 10 07:40:31 UTC 2015


#27935: Multisite get_site_option() does not cache empty string values in
"SITE_ID:notoptions"
-------------------------------------+------------------------------
 Reporter:  doublesharp              |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Options, Meta APIs       |     Version:  3.7
 Severity:  normal                   |  Resolution:
 Keywords:  reporter-feedback close  |     Focuses:  multisite
-------------------------------------+------------------------------
Changes (by jeremyfelt):

 * keywords:  reporter-feedback dev-feedback => reporter-feedback close
 * severity:  major => normal


Comment:

 I can't currently reproduce this with the
 [https://pecl.php.net/package/memcache PECL Memcache extension] and the
 [http://wordpress.org/plugins/memcached Memcached object cache drop-in].

 * Set an option in `wp_sitemeta` with a `meta_key` of testkey and a
 `meta_value` of an empty string.
 * Restart the memcached service to clear cache.
 * Use the following to test (with a couple `var_dump()`s watching for the
 cache hit):

 {{{
 wp> get_network_option( 1, 'testkey' );
 string(10) "cache miss"
 string(0) ""
 wp> get_network_option( 1, 'testkey' );
 string(9) "cache hit"
 string(0) ""
 }}}

 The first `get_network_option()` call retrieved the empty string from the
 database and stored the value in cache as expected using `wp_cache_set()`.
 The second retrieved the value from cache using `wp_cache_get()`.

 I don't see anything in the code that would be treating an empty string
 differently. I imagine this could differ based on the object cache being
 used.

 Happy to explore this further if steps can be provided to reproduce.
 Otherwise it seems like it may be related to the object cache drop-in
 being used.

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


More information about the wp-trac mailing list