Step: 1- Open settings.php file in sites/default and uncomment these lines
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
include $app_root . '/' . $site_path . '/settings.local.php';
}
Step: 2 - Copy sites/example.settings.local.php
to sites/default/settings.local.php
:
Step: 3 -Open settings.local.php and Uncomment these lines
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
$settings['cache']['bins']['page'] = 'cache.backend.null';
Step: 3 - Open development.services.yml file add below line of code under parameters section
twig.config:
debug: true
auto_reload: true
cache: false
After added file look like this
# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
Step: 4 - Rebuild cache
drush cr
or by visiting the following URL from your Drupal 8-9 website:
http://yoursite/core/rebuild.php