0
votes

I have tried several articles to disable the page and template cache in Drupal 8. I am not using drush and find it very annoying I have to manually clear the cache after every change.

sites/default/default.services.yaml

  1. List item
  2. debug: true
  3. cache: false
  4. auto_reload: true

create sites/settings.php & sites/settings.local.php

  1. $config['system.performance']['css']['preprocess'] = FALSE;
  2. $config['system.performance']['js']['preprocess'] = FALSE;
  3. $settings['cache']['bins']['render'] = 'cache.backend.null';
  4. $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
  5. $settings['cache']['bins']['page'] = 'cache.backend.null';

in development.services.yml add the following

    1. twig.config:
        debug: true
        auto_reload: true
        cache: false

Rebuild the cache

  1. http://yoursite/core/rebuild.php or drush cr

Disable cache in configuration -> performance

Be sure to disable dev tools cache

If I make an adjustment to page.html.twig nothing happens til I clear the cache, any other ideas would be great. This would be the latest version of Drupal 8

2

2 Answers

1
votes

Good day! Try to add in you yml file:

services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory

Hope it will help you!

1
votes

With all the steps above I forgot to do one thing

  1. Move the settings.local.php inside sites/default

  2. Uncomment the following in settings.php

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