3

I have followed the steps detailed in this tutorial and many others -> https://knackforge.com/blog/rajamohamed/disable-drupal-8-cache-during-development

I have copied and renamed the sites/example.settings.local.php file as sites/default/settings.local.php

Opened settings.php file in sites/default directory and uncomment these lines:

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

I have uncommented the following lines in settings.local.php to disable the render cache and dynamic page

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

I have opened development.services.yml in the sites folder and added the following lines (to disable twig cache)

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

I have then cleared cache, this has worked for twig it seems as I am able to make changes in my page.html.twig and these update on a standard browser refresh.

However, any changes to by CSS files are requiring a clear cache every time, slowing development down quite a lot over time.

Hoping for some help here.

7
  • What do you have set for "Bandwidth Optimization" at admin/config/development/performance?
    – Clive
    Commented Feb 11, 2017 at 18:45
  • no caching and no aggregation of CSS or JS
    – user43161
    Commented Feb 11, 2017 at 18:49
  • 4
    Are you using chrome? Asset caching got way more aggressive recently for some reason, if you're using it try opening the Network tab in dev tools and selecting "Disable cache"
    – Clive
    Commented Feb 11, 2017 at 18:50
  • 2
    Tell me about it. To save you the inevitable next hassle a bit later: if you use the CSS inspector it will crash silently, a lot, and won't update when you select elements. To fix that you have to go to the dev tool settings and click "relaunch" or whatever the button is. All good again for a bit with the CSS inspector. But of course then the "Disable cache" has toggled back off, which if you're like me you won't realise for a bit and the styles will stop loading again and you won't know why. I haven't seen these problems in Canary so hopefully a fix is on its way soon
    – Clive
    Commented Feb 11, 2017 at 19:08
  • @Clive interesting stuff, why not convert your comments to a real answer here? However, a "fix" is often needed to address a "bug", which I'm sure you know is off topic here. So what's your judgement about this question here, is it about a bug or not? If not would you mind briefly explaining also why not? Commented Feb 11, 2017 at 19:20

1 Answer 1

1

Written by @Clive in the comments

Are you using chrome? Asset caching got way more aggressive recently for some reason, if you're using it try opening the Network tab in dev tools and selecting "Disable cache"

This solved me the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.