Is there a reason you're caching every user you find ($total contains data for multiple users) in a single cache entry rather than making this cache be per user?  If you cached this per user you wouldn't have to do the is_array or array_key_exists check.  The value would also be a lot smaller.