There is a delay between saving code changes in a controller and being able to view them in the browser.
This is frustrating (to say the least) and makes it very hard to develop and debug module code.
I have tried setting up a development environment in docker and it's working quite well except for this nasty and unpredictable delay.
For a minimal example I tried installing the Hello World example module from the Prepare a Module skeleton guide.
My (minimal, but complete) setup is available here: https://github.com/glaux/drupal8docker.
To replicate the delay
- Get the site up and running.
- Log in as
- Navigate to /hello
- Change the markup in the file
- Refresh /hello - the changes will show up after between 5 and 300 seconds.
What I've tried
I've tried disabling all the caches by following the official guides. When making css changes to a custom theme (not included in the minimal repo above) the code changes are visible immediately, so this is not a cache problem I believe.
This is also emphasized by the fact that rebuilding the cache via the interface, drush and/or drupal console seems to have no effect on this delay.
In a similar manner I've tried disabling the browser cache (by opening the dev console on chrome). This have no effect either, nor have clearing the browser cache manually.
How can I get rid of this delay, what am I doing wrong here?
I think Clive could be right that this is possibly on the file system level. Here is an excerpt from the docker-compose file:
volumes: - ./docker/project/modules:/var/www/html/modules - ./docker/project/themes:/var/www/html/themes - ./docker/project/libraries:/var/www/html/libraries - ./docker/project/profiles:/var/www/html/profiles - ./docker/project/sites:/var/www/html/sites # Add anonymous volumes to exclude cache files explicitly - /var/www/html/sites/default/files/js - /var/www/html/sites/default/files/css - /var/www/html/sites/default/files/php
The files are added as explicit volumes, and the changes I make to
HelloController.php are reflected in the image. I'm running this on Windows 10. Could this be the culprit, and how can I test this?