简体   繁体   中英

Docker not reflecting changes real-time (Laravel)

I have Docker desktop ( 2.3.0.4 ) for Mac ( Catalina 10.15.6 ).

What started happening recently is that my changes aren't reflected in real-time when looking from browser perspective.

I have a Laravel app. When I am connected to the app container and when I do the change in my IDE, I notice the file being changed instantly within container as well, so the mapping part works well, however the browser sync happens in about a minute or so (sometimes faster, sometimes slower) which is really frustrating.

For example this part of the code will dump the string within a browser:

public function index()
{
    dd('I am here');
}

However changing to

public function index()
{
    dd('I am there');
}

will require me to wait and wait... PHPStorm has auto-save feature enabled, but I do a CTRL-s just to be sure.

My Docker configuration has 6 cores available with 8GB RAM, having only 5 containers up and running (and we are talking minimal workload there).

I thought it might be due to some caching, but flushing cache didn't work, disabling service workers didn't work and incognito mode didn't work. I always have the delay.

Also, to be sure it's not about the framework, I tried doing artisan optimize:clear frantically, but to no avail.

What can I do to improve the response time? This is a debugging nightmare.

I think that is related to the browser cache If you are using chrome go to the Inspect tab and go to the network and check the "Disable cache" I think it will fix your problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM