Weird caching with deploys

Hi guys, it’s still me :smile:
I have this strange issues very often.

When we run deploys on staging or production environments, while there are more than 5 releases on the server, deploys seem not to be run completely. It looks like there is some caching or delay before we can see changes coming. Of course on the DEV and staging server there are no caching plugins configured nor varnish over them.
I wrote a script that cleans all the dir but it’s a bit rude, do you have ideas on how to avoid this? Should I run cap ENV deploy:cleanup?
I really cannot make my mind about this.

Are you using bedrock-ansible? Either way I assume you’re using php-fpm?

Check this change:

Basically there can be issues with deploys that use symlinks (like Capistrano) and the symlink isn’t updated to resolve to the new release. Using $realpath in Nginx can solve this.

Could it be the same for php-cgi which is running on my server?

Possibly. Apache has the same problem as well. See