[ticket/12681] Generate the list of the route only when needed

PHPBB3-12681