ztskha
Last Updated: February 25, 2016
·
9.578K
· elbcoast
Pierrequadrat

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.

Say Thanks
Respond

4 Responses
Add your response

10631
Ea515cae5dc5ed9b33e8ee9ed16c48dc

Thanks a lot !

over 1 year ago ·
14683
45d189a10ccfbe2c66414e3d3550b353

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
None

Thanks! You make my day!

over 1 year ago ·
Filed Under