I am in the process of building a Vagrant Box for work. All was going great until I ended up having to spend the best part of two days trying to figure out why static files (css, javascript etc) were not being served after being updated on the host file system.

Turns out that VirtualBox has had a “bug” for around three years where if “sendfile” is enabled in the web server you are running it won’t serve a file after it has been changed on the file system mounted from the host machine.

This function, a kernel call to copy files directly from disc to TCP, is used by both NGINX & Apache to help serve static content more efficiently.

The issue is documented here ….

…. hopefully this post will save anyone messing about ETAGS, NFS or caching settings within their web server or applications for hours.

Also, it was a good lesson in Google early (hence the Picard faceplam) !!!

Written by Russ McKendrick

I am he as you are he as you are me and we are all together

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s