From 04159a98237edbfe3507dc77544424ab71739294 Mon Sep 17 00:00:00 2001 From: Bec White Date: Mon, 24 Oct 2022 15:16:17 -0500 Subject: [PATCH 1/3] Move dev caching settings to settings.local.php and services.local.yml to make them easier to turn on and off. --- .gitignore | 1 + .../sites/default/default.services.local.yml | 17 +++++++++++++++++ .../sites/default/default.settings.local.php | 18 +++++++++++++++--- .../sites/default/settings.ddev-overrides.php | 11 +---------- 4 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 docroot/sites/default/default.services.local.yml diff --git a/.gitignore b/.gitignore index 1676a79..2193169 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ web/sites/*/files docroot/sites/*/files # Ignore local Drupal configuration +services.local.yml settings.local.php settings.ddev.php diff --git a/docroot/sites/default/default.services.local.yml b/docroot/sites/default/default.services.local.yml new file mode 100644 index 0000000..853b724 --- /dev/null +++ b/docroot/sites/default/default.services.local.yml @@ -0,0 +1,17 @@ +# @file +# Local development services. +# +# Copy this file to 'local.services.yml' and customize for your development needs. + +services: + cache.backend.null: + class: Drupal\Core\Cache\NullBackendFactory +parameters: + # The debug cacheability header can get very long and cause HTTP 500 errors. If this + # happens on your site, change this to false. + http.response.debug_cacheability_headers: true + twig.config: + debug: true + auto_reload: true + # This is important if you're using interactive debugging with Twig templates. + cache: true diff --git a/docroot/sites/default/default.settings.local.php b/docroot/sites/default/default.settings.local.php index 41f602f..80496fc 100644 --- a/docroot/sites/default/default.settings.local.php +++ b/docroot/sites/default/default.settings.local.php @@ -7,7 +7,19 @@ * Copy this file to 'settings.local.php' and customize for your development needs. */ -// To simulate other config split environments, change "development" to either "staging" -// or "production", then run: +// To simulate other config split environments, uncomment these split lines, then run: // drush cr && drush cim -y -# $config['config_split.config_split.development']['status'] = TRUE; +# $config['config_split.config_split.development']['status'] = FALSE; +# $config['config_split.config_split.production']['status'] = TRUE; + +// Customizable development services file. +$settings['container_yamls'][] = DRUPAL_ROOT . '/' . $site_path . '/services.local.yml'; + +// Disable caching. +$settings['cache']['bins']['render'] = 'cache.backend.null'; +$settings['cache']['bins']['page'] = 'cache.backend.null'; +$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null'; + +// Disable CSS and JS aggregation. +$config['system.performance']['css']['preprocess'] = FALSE; +$config['system.performance']['js']['preprocess'] = FALSE; diff --git a/docroot/sites/default/settings.ddev-overrides.php b/docroot/sites/default/settings.ddev-overrides.php index 66db687..f5b4c8d 100644 --- a/docroot/sites/default/settings.ddev-overrides.php +++ b/docroot/sites/default/settings.ddev-overrides.php @@ -20,21 +20,12 @@ assert_options(ASSERT_ACTIVE, TRUE); Handle::register(); -// Enable local development services. +// Enable local development services, including the null cache backend. $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml'; // Show all error messages, with backtrace information. $config['system.logging']['error_level'] = 'verbose'; -// Disable caching. -$settings['cache']['bins']['render'] = 'cache.backend.null'; -$settings['cache']['bins']['page'] = 'cache.backend.null'; -$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null'; - -// Disable CSS and JS aggregation. -$config['system.performance']['css']['preprocess'] = FALSE; -$config['system.performance']['js']['preprocess'] = FALSE; - // Allow test modules and themes to be installed. $settings['extension_discovery_scan_tests'] = FALSE; From 27255738985070b62efd175011f38d4ba18b06e6 Mon Sep 17 00:00:00 2001 From: Bec White Date: Wed, 4 Jan 2023 09:28:52 -0600 Subject: [PATCH 2/3] Settings line for each config split environment. --- docroot/sites/default/default.settings.local.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docroot/sites/default/default.settings.local.php b/docroot/sites/default/default.settings.local.php index 80496fc..e04499f 100644 --- a/docroot/sites/default/default.settings.local.php +++ b/docroot/sites/default/default.settings.local.php @@ -7,9 +7,10 @@ * Copy this file to 'settings.local.php' and customize for your development needs. */ -// To simulate other config split environments, uncomment these split lines, then run: +// To simulate other config split environments, uncomment and edit these lines, then run: // drush cr && drush cim -y # $config['config_split.config_split.development']['status'] = FALSE; +# $config['config_split.config_split.test']['status'] = FALSE; # $config['config_split.config_split.production']['status'] = TRUE; // Customizable development services file. From 7860cc44d90c8bd903dd0937bd87e48676616568 Mon Sep 17 00:00:00 2001 From: Bec White Date: Wed, 4 Jan 2023 09:29:55 -0600 Subject: [PATCH 3/3] Fix comment. --- docroot/sites/default/default.services.local.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docroot/sites/default/default.services.local.yml b/docroot/sites/default/default.services.local.yml index 853b724..ba91280 100644 --- a/docroot/sites/default/default.services.local.yml +++ b/docroot/sites/default/default.services.local.yml @@ -1,7 +1,7 @@ # @file # Local development services. # -# Copy this file to 'local.services.yml' and customize for your development needs. +# Copy this file to 'services.local.yml' and customize for your development needs. services: cache.backend.null: