Fix EZP-21495: (Persistence) cache does not support multi repository setup

Review ping @lolautruche ( Feeback on approach and how to best test this wanted ;) )