不能为开发禁用 Drupal 8 缓存

Drupal 8 cache can't be disabled for development

尽管我遵循了本文中的所有步骤,但我仍然需要在 Drupal 中手动清除缓存 (config/development/performance): https://www.drupal.org/node/2598914

我按照启用本地开发设置

标题下的步骤操作

我使用 MAMP 并在 MAMP 设置中禁用了缓存。

尝试将以下内容添加到 'services' 下的 development.services.yml:

cache.backend.memory:
class: Drupal\Core\Cache\MemoryBackendFactory

并将这些行添加到您的 settings.local.php:

$config['system.performance']['css']['gzip'] = FALSE;
$config['system.performance']['js']['gzip'] = FALSE;
$config['system.performance']['response']['gzip'] = FALSE;

问题出在我的 sites/development.services.yml 文件中。 parameters: 被定义了两次。该文件应如下所示:

# Local development services.
#
# To activate this feature, follow the instructions at the top of the
# 'example.settings.local.php' file, which sits next to this file.
services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory
parameters:
  twig.config:
    debug: true
    auto_reload: true
    cache: false