Solving Vagrant and NFS file caching issues when using gulp watch

Do you find that gulp watch doesn't detect changes instantly on your Vagrant box?

Add "lookupcache=none" to your Vagrantfile

Change your Vagrantfile synced_folder line from:

config.vm.synced_folder "./", "/vagrant", type: "nfs"

to

config.vm.synced_folder "./", "/vagrant", type: "nfs", mount_options: ["lookupcache=none"]

Alternatively you could set the cache to 1 second

config.vm.synced_folder "./", "/vagrant", type: "nfs", mount_options: ["actimeo=1"]

Alternatively use Samba to mount instead of NFS which will detect file changes instantly.