I did Disable Drupal 8 caching during development step by step ( also finally rebuild the cache) but yet my changes in twig files not take effects without rebuild the cache.

sites/default/services.yml :

    session.storage.options: { gc_probability: 1, gc_divisor: 100, gc_maxlifetime: 200000, cookie_lifetime: 2000000 }
    twig.config: { debug: true, auto_reload: true, cache: false }

sites/default/settings.php :

 if (file_exists(__DIR__ . '/settings.local.php')) {
   include __DIR__ . '/settings.local.php';

sites/default/settings.local.php :

$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;

sites/development.services.yml :

    class: Drupal\Core\Cache\NullBackendFactory
    debug: true
    auto_reload: true
    cache: false

Where is the Problem?

  • did you restart apache after making changes? – No Sssweat Jun 5 '16 at 10:44
  • @NoSssweat everything seems Ok,after your comment I try that but no achievement . – Yusef Jun 5 '16 at 11:26
  • in sites/default/settings.local.php uncomment the $settings['cache']['bins']['render'] = 'cache.backend.null'; line – No Sssweat Jun 5 '16 at 13:05
  • 1
    @NoSssweat I found my solution with ` $settings['cache']['bins']['render'] = 'cache.backend.null'; $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';` . thanks for your attention – Yusef Jun 5 '16 at 13:13

I resolved my problem by following lines in settings.local.php.

# $settings['cache']['bins']['render'] = 'cache.backend.null';

duplicate the line and enable it (by remove # before it) and change render to dynamic_page_cache I mean the following line resolved your issue

 $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';

in Drupal >= 8.8 use

  $settings['cache']['bins']['render'] = 'cache.backend.memory';

For those who are struggling for configuring caching for Drupal 8 - Just copy the example.settings.local.php which is located outside of the files folder into files folder with settings.local.php - uncomment $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null'; - Again, uncomment $settings['cache']['bins']['page'] = 'cache.backend.null';


In Drupal 8.8 adding this to sites/default/settings.local.php worked for me:

$settings['cache']['bins']['render'] = 'cache.backend.memory';

For some reasons when I try to add it as recommended ('cache.backend.null') I have the following error

Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "cache.backend.null". Did you mean one of these: "cache.backend.apcu", "cache.backend.memory", "cache.backend.php"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.