清除drupal缓存的方法:
最常用的就是在后台操作 The easiest way to clear the Drupal cache is to go to
dmin/config/development/performance
Administration > Configuration > Development > Performance
-------------
还有其他的方法,可以看官网文档:
https://www.drupal.org/node/42055
----
用drupalconsole清缓存: $ drupal cr all
http://docs.drupalconsole.com/en/commands/cache-rebuild.html
-----------
补充:
当修改drupal8的主题时,总是要清缓存,这是很烦的一件事。
缓存对于网站来说是好事,但当在本地开发时,这就变成一件麻烦的事了。
怎么办?
官网有文档提供解决方案: https://www.drupal.org/node/2598914
----------------
具体步骤如下:
要改两个文件。一个是sites/default/settings.local.php ,另一个是 /sites/development.services.yml
Steps
1. 复制 sites/example.settings.local.php 到sites/default,并重命名为 settings.local.php
2.打开 sites/default/settings.php ,把下面几行注释
if (file_exists(__DIR__ . '/settings.local.php')) {
include __DIR__ . '/settings.local.php';
}
意思就是可以调用sites/default/settings.local.php文件了
3. 打开 sites/default/settings.local.php,改下面的内容
取消注释
$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
如果不安装新模块或主题,则扫描功能可以关闭:
$settings['extension_discovery_scan_tests'] = FALSE;
下面表示调用development.services.yml文件:
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
修改:(css或js是否合并,设置为false )
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;
加下面的代码 ,可以查看twig主题文件。
parameters:
twig.config:
debug: true
auto_reload: true
cache: false