@synchronize access to the cache to ensure thread safety.