Hi y'all. I'm brand new to Drupal and trying to get into theming so I can hopefully replace WordPress in my current workflow. However, I'm having an issue with turning off the caching in version 8.1.

Following any of a great number of tutorials on the web regarding the situation, I've copied /sites/example.settings.local.php to /sites/default/settings.local.php, set

$config['system.performance']['css']['preprocess'] = true;
$config['system.performance']['js']['preprocess'] = true;

Uncommented the lines

$settings['cache']['bins']['render'] = 'cache.backend.null';
$settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';

In /sites/default/settings.php, I've uncommented the following:

if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}

This block is followed only by the database credentials, install profile, and sync config directory in the file.

Finally, my /sites/development.services.yml file looks like this:

services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory

parameters:
  twig.config:
    debug : true
    auto_reload: true
    cache: false

And ... nothing. Right now, I'm getting what is apparently a fairly common error - the Symfony ServiceNotFoundException 'You have requested a non-existent service "cache.backend.null"'. What I've found on the web about this recommends loading the rebuild.php script. Problem being, that script also throws the ServiceNotFoundException.

Any advice on what I'm missing here? From what I'm reading about Drupal, I think I'm gonna like programming with it quite a lot - I just really don't relish the idea of having to clear the cache for each and every small change that I make while developing.

Thanks in advance for any and all advice!

Comments

Jeff Burnz’s picture

I don't really know what that settings.local.php file is for, I wonder if it's for a multisite site, not sure - not my area, however if I copy...

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

...to settings.php, clear the cache, it works, at least that is how I am doing it.

FTR: ['preprocess'] = TRUE is going to enable CSS/JS aggregation/magnification.

Of course you can always just goto /admin/config/development/performance in admin and turn it off manually.

maxxd’s picture

Thank you - that worked!