In my Ubuntu Apache setup running under Sun’s VirtualBox, I have my DocumentRoot set to an NFS path pointing to my Windows Vista host. I spent a shit load of time trying to figure out how to stop the caching of the static files delivered through Apache. To try to pinpoint what the problem was, I started adding commands such as ‘CacheDisable /’ in the Apache configuration files but with no success. It was still serving the first browser copy of the static file. I was doing some development work so I had to make sure my CSS files change as soon as I hit save in Eclipse. I then tried uninstalling Apache, and thought maybe it’s the version I’m using. Wasn’t a good idea. So past the bullshit, I got it to work with:
<Directory “/var/www/public_html/”>
Options Indexes FollowSymLinks ExecCGI MultiViews
AllowOverride All
Order allow,deny
allow from all
EnableMMAP Off
EnableSendfile Off
</Directory>
EnableMMAP allows us to turn off mapping of files, and EnableSendfile allows us to turn off the kernel’s caching of the files. Yay! Now I can get back to what’s important, developing.