ztskha
Last Updated: February 25, 2016
·
10.26K
· elbcoast

Vagrant: Apache/nginx serving outdated static files? Turn off sendfile()!

Made some changes to static files (css for example), but Apache/nginx on your Vagrant VM still delivering the old version or even corrupted files? Then you should turn off sendfile() in your Apache/nginx configuration!

Simply spoken, sendfile() uses kernel calls to copy files directly from disc to tcp. If you are using remote filesystems (like nfs or the VirtualBox Guest Additions stuff), this method isn't reliable.

You can find more info about sendfile() in this techrepublic article.

To turn off sendfile() in Apache, you can use the EnableSendfile off directive, for nginx use sendfile off.

4 Responses
Add your response

10631

Thanks a lot !

over 1 year ago ·
14683

Wow thanks! I've been searching for this for hours but all I was finding was stuff about etags/mod_expires which I knew was not the issue.

over 1 year ago ·
16081

Thanks!
I was playing wit ETags and headers with no luck. Got to dive into the SendFile subject in my spare time.

over 1 year ago ·
20868

Thanks! You make my day!

over 1 year ago ·
Filed Under