Problem/Motivation
It used to require a lot of steps to disable caching, but #3278493: Make it easier for theme builders to enable Twig debugging and disable render cache (May 2023) allowed disabling Twig caching (and disable render, and page caches) from the UI, making it a lot easier
Proposed resolution
Make it even easier to achieve a basic set up, covering the needs for most basic theming, by bypassing Twig caching, general caching, and CSS and JS aggregation for both theming and code in Drupal 11, by simply running drush caching_aggregation:disable
, and enable again with drush caching_aggregation:enable
.
An alternative method could be adding a one-liner in settings.php
:$settings['caching_aggregation'] = FALSE;
In the meantime, is something like this possible, bypassing caching by adding a one-liner in a file?
https://www.garfieldtech.com/blog/drupal-cache-disable
Remaining tasks
With #3278493: Make it easier for theme builders to enable Twig debugging and disable render cache, you can now disable Twig caching and overall caching from the GUI or Drush, so also disabling aggregation in an easy way, via GUI, Drush and settings.php
would be great. Essentially doing this:
- Disable Twig Caching: Check all four checkboxes
- Disable CSS and JS aggregation: Disable both
Ideally, with just one action, the user should be able to disable or enable the standard caching/aggregation settings. This could be by:
- Set
$settings['caching_aggregation'] = FALSE;
or$settings['caching_aggregation'] = TRUE;
in setting.php - Run
drush caching_aggregation:disable
ordrush caching_aggregation:enable
- Install or uninstall a custom module (not ideal, since it requires a lot of steps)