isCacheValid(snapshot, mainCompilation) {
    if (!this.compilationState.isVerifyingCache) {
      return Promise.reject(
        new Error(
          "Cache validation can only be done right before the compilation starts",
        ),
      );
    }
    // If there are no entries we don't need a new child compilation
    if (this.compilationState.entries.length === 0) {
      return Promise.resolve(true);
    }
    // If there are new entries the cache is invalid
    if (
      this.compilationState.entries !== this.compilationState.previousEntries
    ) {
      return Promise.resolve(false);
    }
    // Mark the cache as invalid if there is no snapshot
    if (!snapshot) {
      return Promise.resolve(false);
    }

    return PersistentChildCompilerSingletonPlugin.isSnapshotValid(
      snapshot,
      mainCompilation,
    );
  }
Verify that the cache is still valid
@private
@param {Snapshot | undefined} snapshot
@param {Compilation} mainCompilation
@returns {Promise<boolean | undefined>}