Compat: Do not dump empty strings into objects.cache.

Fixes #5450