Implemented deduplication and conservative memory consumption for cache.