truncateTo(maxAllowedCacheSize) {
    if (this._size <= maxAllowedCacheSize) return;

    const requests = this._cachedRequests;

    const sortedRequestIds = Object.keys(requests).sort(
      (a, b) => requests[a].createdAt - requests[b].createdAt,
    );

    for (const requestId of sortedRequestIds) {
      this.delete(requestId);
      if (this._size <= maxAllowedCacheSize) return;
    }
  }
Truncate the cache to the given size, according to a First-In-First-Out (FIFO) policy

@param {number} maxAllowedCacheSize