Object cache bug?
-
Hi, I’m working on a small plugin that needs to distinguish between an empty option and an option that is not set. This is normally done reliably by looking at what
get_option()returns: an empty value ” (when empty) or the boolean false (when not found).I have noticed that when Object caching (in my case via Redis socket, have not tested other scenarios) is on, this behavior is not always consistent.
When the empty value is fetched from the DB and stored by the cache, the response is always ” (correct) but right after saving the empty option from admin,
get_option( 'my_setting' )starts responding withfalseinstead of ” (not correct!).Only after a cache purge, the correct response is back. Or if I disable the Object caching on the admin entirely, of course…
Is this a known issue?
The topic ‘Object cache bug?’ is closed to new replies.