[Resolved] [Plugin: APC Object Cache Backend] False negatives due to equality check instead of identicality che
This is reproducable with a clean install of WordPress as it affects a core function.
is_multi_author()function stores its result in the cache as 0 or 1.
In APC Object Cache’s
get()function we see this line:
if ( 'checkthedatabaseplease' == $value ) $value = false;
Due to implicit type comparison in PHP,
'checkthedatabaseplease' == 0evaluates to true, which sets the return value to false, which gives
is_multi_author()a false negative on the cache hit and therefore forces it to hit the database every time, when it doesn’t need to.
This means we get an unecessary database hit on every single page load because
is_multi_author()is used in
Easy fix. APC Object Cache just needs to check for identicality instead of equality:
if ( 'checkthedatabaseplease' === $value ) $value = false;
- The topic ‘[Resolved] [Plugin: APC Object Cache Backend] False negatives due to equality check instead of identicality che’ is closed to new replies.