VirtualBox and Nginx very slowly serving cached static JS and CSS files

Apparently this is a rather known issue: Vagrant/VirtualBox/Apache2 Strange Cache Behaviour,,, that attempting to use VirtualBox with Nginx or Apache exhibits buggy behavior (modifying a file will update the contents, but not the length, so making it shorter leads to garbage at the end, and making it longer just truncates at the original length). The solution is always to disable sendfile.

So I disabled sendfile and this actually fixed my problem, but now I see all of those static files taking 2-3 seconds to load every time.

  • Can not start Docker 1.9.1
  • Kubernetes pods versus Docker container in Google's codelabs tutorial
  • Golang failes to change the name of imported module
  • Setting up Jetty Runner with custom Cert in Docker Build File
  • Kubernetes on Mesos, no suitable offer available
  • Why my docker container apache service will be shut down everytime I attach my container and then exit?
  • Has anyone seen this sort of behavior before? I’m specifically using Boot2Docker to run Nginx and an app in PHP

  • How to prevent Docker's container from being stopped after exiting a /bin/bash session
  • How to apply new logrotate config for syslog, without restarting the system?
  • django cms filer uploads fail
  • Docker for mac does not pull any image
  • How can I terminate a Docker instance from within itself?
  • Using dotnet from docker to power Visual Studio C# extension (OmniSharp)
  • 2 Solutions collect form web for “VirtualBox and Nginx very slowly serving cached static JS and CSS files”

    There is a known issue on github about volume performance in boot2docker:

    In that issue there is an interesting link about a A productive development environment with Docker on OS X.

    • What about a shared folder in VirtualBox?

    Don’t use this feature for nginx inside a VM, create a real shared resource on the host instead.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.