$key = 'routing.non_admin_routes';
if ($cache =
$this->cache->
get($key)) { $routes =
$cache->data;
} else { $routes =
$this->state->
get($key,
[]);
$this->cache->
set($key,
$routes, Cache::PERMANENT,
['routes'
]);
} if ($routes) { // Preload all the non-admin routes at once.
$this->routeProvider->
preLoadRoutes($routes);
} } } /**
* Alters existing routes for a specific collection.
*
* @param \Drupal\Core\Routing\RouteBuildEvent $event
* The route build event.
*/
public function onAlterRoutes(RouteBuildEvent
$event) {