protected function ascertainRoutingData(?string $routeName = null): void
	{
		if (($routeName !== null) && empty($this->routes[$routeName]))
		{
			throw new \InvalidArgumentException(\sprintf('Route %s is not registered.', $routeName));
		}

		if (($this->dispatcher === null) || ($this->parsedRoutes === null) || (!empty(\array_diff_key($this->routes, $this->parsedRoutes))))
		{
			$routingData = $this->cacheStorage->getItem(self::CACHE_KEY);
			//Check if cached routing data corresponds with added routes
			if (($routingData !== null) && (!empty(\array_diff_key($this->routes, $routingData[1]))))
			{
				$routingData = null;
			}
			//Generate and cache routing data anew if needed
			if ($routingData === null)
			{
				$routingData = $this->generateRoutingData();
				$this->cacheStorage->setItem(self::CACHE_KEY, $routingData);
			}
			$this->dispatcher = new FR\Dispatcher\GroupCountBased($routingData[0]);
			$this->parsedRoutes = $routingData[1];
		}
	}