Fixed #4278 - inconsistent serialization in case of multiple defined caches

fixes inconsistent serialization in case of multiple defined caches