I have recently set up a virtual server environment using VirtualBox for quick web development. Using shared folders feature, I wanted to avoid file uploads between VM host and guest. However, when I make request to an updated a file, server responses with the old version.
First, I cleared and disabled my browser cache. The result was the same. Second, I checked the file both on host and guest machines. Both were up to date, so the issue was about the server. Then I have made some experiments with expires headers, again, no luck.
I continued searching on the internet and found this blog post. Sendfile option is disabled by default on Nginx (see documentation), but apparently Ubuntu had turned it on with the configuration file on the package. You can turn it off by setting the flag off or commenting the line:
# sendfile on; # or sendfile off;
Sendfile is enabled by default of Apache. In order to turn it off, you can refer to the official documentation here.