- Open a terminal and navigate to an installed Drupal directory.
- We use the cache-rebuild command in Drush to rebuild all of Drupal's caches, including routes:
$ drush cache-rebuild
Cache rebuild complete.
- In Drupal Console, we use the cache:rebuild command to clear specific cache bins. The input uses autocomplete to help specify a specific cache bin to clear. In this example, we clear the render cache:
$ drupal cache:rebuild all
Select cache. [all]:
> render
Rebuilding cache(s), wait a moment please.
[OK] Done clearing cache(s).
- If we only need to rebuild our routes in Drupal, we can use the router:rebuild command in Console. This will keep render, discovery, and other caches, but expose new routes:
$ drupal router:rebuild
Rebuilding routes, wait a moment please
[OK] Done rebuilding route(s).
- Drush provides twig-compile to rebuild templates. Passing the verbose option displays templates being compiled:
$ drush twig-compile --verbose