禁用整个缓存(树枝 + Drupal 缓存):
首先复制并重命名sites/example.settings.local.php
为sites/default/settings.local.php
$ cp sites/example.settings.local.php sites/default/settings.local.php
然后打开settings.php
文件sites/default
并取消注释这些行:
# if (file_exists(__DIR__ . '/settings.local.php')) {
# include __DIR__ . '/settings.local.php';
# }
现在打开settings.local.php
并更改为TRUE
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
并取消注释所有这些以禁用渲染缓存和禁用动态页面缓存
# $settings['cache']['bins']['render'] = 'cache.backend.null';
# $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
对于树枝缓存打开development.services.yml
并添加
parameters:
twig.config:
debug : true
auto_reload: true
cache: false
欲了解更多信息https://www.drupal.org/node/2598914