Drupal - If you update a routes file in Drupal 8 how do you clear the cache?

You can use

drush ev '\Drupal::service("router.builder")->rebuild();'

to rebuild the routing information without clearing all the caches.


An alternative to drush is drupal console, which you can then use as:

drupal router:rebuild

Which is a little less typing than the drush ev answer (and a tinsy bit faster, too).

To install drupal console

curl -LSs http://drupalconsole.com/installer | php
mv console.phar /path/to/a/suitable/bin/drupal

drush cc router    

when using drush 9 do the trick now :-)

Tags:

Caching

Routes

8