How to disable caching on a route with controller in drupal 8 and drupal 9
To disable cache at route level or custom page level, we have multiple ways. Check the following snippet to understand them.
- use 'no_cache' from the routing.yml file OR
- use 'max-age' from the controller method OR
- use 'page_cache_kill_switch' drupal service
Use anyone of the method above to disable cache at routing level or controller level in drupal 8 or drupal 9
- use 'no_cache' from the routing.yml file OR
- use 'max-age' from the controller method OR
- use 'page_cache_kill_switch' drupal service
Use anyone of the method above to disable cache at routing level or controller level in drupal 8 or drupal 9
Share
share your add link
https%3A%2F%2Fmycode.blog%2Fkrishna-kanth%2Fhow-disable-caching-route-controller-drupal-89%0A
Share in social
Comments