Skip to content

Instantly share code, notes, and snippets.

@frankyonnetti
Last active April 16, 2025 18:29
Show Gist options
  • Select an option

  • Save frankyonnetti/5024b8026a915b7df476e4318840c806 to your computer and use it in GitHub Desktop.

Select an option

Save frankyonnetti/5024b8026a915b7df476e4318840c806 to your computer and use it in GitHub Desktop.
Drupal 8 - cache #drupal #d8 #cache

Disable Drupal 8 caching during development

  1. Copy and rename:
  • sites/example.settings.local.php --> sites/default/settings.local.php
  • uncomment the following lines (search for it):
  $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
  $settings['cache']['bins']['render'] = 'cache.backend.null';
  $settings['cache']['bins']['page'] = 'cache.backend.null';
  $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
  1. Open sites/default/settings.php
  • uncomment these lines (717):
  if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
    include $app_root . '/' . $site_path . '/settings.local.php';
  }
  1. Open development.services.yml in the sites folder and add the following block to disable the twig cache:
    parameters:
      twig.config:
        debug: true
        auto_reload: true
        cache: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment