Score:0

I'm not able to fully disable caching during development

jp flag

I'm currently developing a new Drupal 9 website. I build quite a few custom modules for this but for some reason the changes I make in the modules during development are not visible immediately.

I disabled caching as described in this post.

The strange thing is that, even when I run drush cr the changes are not active. I also have my chrome development window open so the browser is not caching the pages either. I have to empty cache and save the page a few times to get it to work.

What can I do to further disable caching so I don't have to empty the cache after I made a change?

cn flag
`drush cr` is all you need to do from the Drupal side, if that’s not working check your browser settings, VM settings if applicable, settings for any reverse proxy you have active, that sort of thing
Joost avatar
jp flag
Sorry I don't understand. I'm using `drush cr` to empty the cache and this is not working. And cache is disabled in my browser. What is VM or a Reverse Proxy?
No Sssweat avatar
ua flag
I noticed [that post](https://www.drupal.org/node/2598914) its missing `cache: false` under the `twig.config:` in development.services.yml
Joost avatar
jp flag
Thanks, I had a look but I do have this line of code in my development.services.yml file. So this is not the problem. But I think I fixed it. The comment of Clive made me look a little further then I did before. And it looks like disabling the OPcache in MAMP does the trick.
leymannx avatar
ne flag
The moment you add a new library definition or new file to an existing definition or new hook you need to flush cache anyways.
Score:0
co flag

The post (Disable Drupal (>=8.0) caching during development) had been updated, you may consider use the Mix module to disable caches during development.

By toggling "Enable development mode" checkbox, you can switch between Dev/Prod modes easily without editing any settings*.php and *services.yml files.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.