Drupal 8 禁用模板(页面和节点)缓存
Drupal 8 disable template (page & node) cache
我已经尝试了几篇文章来禁用 Drupal 8 中的页面和模板缓存。我没有使用 drush,发现它很烦人我必须在每次更改后手动清除缓存。
sites/default/default.services.yaml
- 列表项
- 调试:真
- 缓存:错误
- auto_reload: 真
创建 sites/settings.php & sites/settings.local.php
- $config['system.performance']['css']['preprocess'] = 假;
- $config['system.performance']['js']['preprocess'] = 假;
- $settings['cache']['bins']['render'] = 'cache.backend.null';
- $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
- $settings['cache']['bins']['page'] = 'cache.backend.null';
在development.services.yml中添加以下内容
1. twig.config:
debug: true
auto_reload: true
cache: false
重建缓存
- http://yoursite/core/rebuild.php 或 drush cr
在配置 -> 性能中禁用缓存
务必禁用开发工具缓存
如果我对 page.html.twig 进行调整,在我清除缓存之前没有任何反应,任何其他想法都会很棒。这将是最新版本的 Drupal 8
美好的一天!
尝试在你的 yml 文件中添加:
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
希望对您有所帮助!
上面的所有步骤我忘了做一件事
将settings.local.php移到sites/default
里面
取消注释 settings.php
中的以下内容
if (file_exists(DIR . '/settings.local.php')) {
包括 DIR 。 '/settings.local.php';
}
我已经尝试了几篇文章来禁用 Drupal 8 中的页面和模板缓存。我没有使用 drush,发现它很烦人我必须在每次更改后手动清除缓存。
sites/default/default.services.yaml
- 列表项
- 调试:真
- 缓存:错误
- auto_reload: 真
创建 sites/settings.php & sites/settings.local.php
- $config['system.performance']['css']['preprocess'] = 假;
- $config['system.performance']['js']['preprocess'] = 假;
- $settings['cache']['bins']['render'] = 'cache.backend.null';
- $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
- $settings['cache']['bins']['page'] = 'cache.backend.null';
在development.services.yml中添加以下内容
1. twig.config:
debug: true
auto_reload: true
cache: false
重建缓存
- http://yoursite/core/rebuild.php 或 drush cr
在配置 -> 性能中禁用缓存
务必禁用开发工具缓存
如果我对 page.html.twig 进行调整,在我清除缓存之前没有任何反应,任何其他想法都会很棒。这将是最新版本的 Drupal 8
美好的一天! 尝试在你的 yml 文件中添加:
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory
希望对您有所帮助!
上面的所有步骤我忘了做一件事
将settings.local.php移到sites/default
里面
取消注释 settings.php
中的以下内容if (file_exists(DIR . '/settings.local.php')) { 包括 DIR 。 '/settings.local.php'; }