Creates a new document cache.
Service container instance to hook into document lifecycle events.
Optionalstate: DocumentStateOptional document state on which the cache should evict.
If not provided, the cache will evict on DocumentBuilder#onUpdate.
Deleted documents are considered in both cases.
Providing a state here will use DocumentBuilder#onDocumentPhase instead,
which triggers on all documents that have been affected by this change, assuming that the
state is DocumentState.Linked or a later state.
ProtectedcacheDispose this object.
Protectedthrow
Every key/value pair in this cache is scoped to a document. If this document is changed or deleted, all associated key/value pairs are deleted.