5

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 :

parameters:
    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 :

services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory
parameters:
  twig.config:
    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 Mohamadi 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 Mohamadi Jun 5 '16 at 13:13
7

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';
0

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';

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.