Fix a bug in caching: multiple domains