[wp-trac] [WordPress Trac] #33276: redundant wp_using_ext_object_cache check in get/set_transient

WordPress Trac noreply at wordpress.org
Wed Aug 5 23:58:42 UTC 2015


#33276: redundant wp_using_ext_object_cache check in get/set_transient
--------------------------+------------------------------
 Reporter:  shmulikk      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cache API     |     Version:  2.8
 Severity:  normal        |  Resolution:
 Keywords:  2nd-opinion   |     Focuses:  performance
--------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => 2nd-opinion
 * version:  4.2.3 => 2.8


Comment:

 Replying to [comment:1 atomicjack]:
 > Submit a .patch/.diff file and unit tests.
 Please be a little more polite when interacting with other people on Trac.
 This sort of comment is not very welcoming for shmulikk.

 Replying to [ticket:33276 shmulikk]:

 @shmulikk Thanks for the report, and welcome to WordPress Trac.

 Unfortunately there's currently no unit test coverage for persistent
 object caching. It's a difficult thing to test because it typically
 requires multiple page loads in order to verify its behaviour. That said,
 removing the `wp_using_ext_object_cache()` conditional check means that
 the `$group` argument used for transients changes from `transient` to
 `options`. This creates potential for cache pollution if a transient
 shares its key with an option, or vice versa.

 There is potential to allow `get_transient()` to fall back to its non-
 persistent cache behaviour when there's no value for the transient in the
 object cache, but this would likely mean an extra database query each time
 this happens because the value won't be present in the `$alloptions`
 array.

 If object cache fault tolerance is desirable it'll need to be a bit more
 robust. Suggestions welcome.

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


More information about the wp-trac mailing list