If IBuildCache.Restore will be also called, the cache must be locked first using the IBuildCache.LockForBuilder method.
public bool Contains(BuildKey builder, IDependencyFingerprint fingerprint) { lock (cache) { MemoryCacheItem item; if (cache.TryGetValue(builder, out item)) { return item.MatchesFingerprint(fingerprint); } else { return false; } } }