Revert "Issue #2370457 by AndreyMaximov: Removed excessive array exploding/concatenation in the cache functions."

This reverts commit dd5aacc27bd2e0ceda857ce2bd40d84b085ad3ba.
Issue #2370457 by AndreyMaximov: Removed excessive array exploding/concatenation in the cache functions.