I’ve been working on setting up a VM running a LAMP stack along with ColdFusion 9 (which I’ll blog about soon). I’ve got everything up and running and was tinkering around making some updates to our TACFUG site but was running into this weird issue that my CSS would not update – I would make a change and it wouldn’t show up in the browser.
I disabled all my browser cache and tried it in Chrome – same issue. I tried adding a UUID to the CSS call to force the browser to reload.
Then I thought it might be a ColdFusion issue so I spent some time in the Administrator turning all the options on/off (lots of new stuff in CF9!). That didn’t work either.
Finally I pinged Twitter and John Mason helped me figure out that it was actually an Apache issue. His first thought was it was some caching module but looking in mods-enabled I didn’t see anything cache related. We were both searching on Google and found a few posts where people had similar issues and mentioned adding a line to their config file:
Enable Sendfile Off
I have no idea what this does – but I opened up my apache2.conf file, scrolled to the bottom and added it. Restarted Apache and my CSS was now refreshing!
The Apache docs mention that in some circumstances you may need to disable this:
This directive controls whether
httpdmay use the sendfile support from the kernel to transmit file contents to the client. By default, when the handling of a request requires no access to the data within a file — for example, when delivering a static file — Apache uses sendfile to deliver the file contents without ever reading the file if the OS supports it.This sendfile mechanism avoids separate read and send operations, and buffer allocations. But on some platforms or within some filesystems, it is better to disable this feature to avoid operational problems:
- Some platforms may have broken sendfile support that the build system did not detect, especially if the binaries were built on another box and moved to such a machine with broken sendfile support.
- On Linux the use of sendfile triggers TCP-checksum offloading bugs on certain networking cards when using IPv6.
- On Linux on Itanium, sendfile may be unable to handle files over 2GB in size.
- With a network-mounted
DocumentRoot(e.g., NFS or SMB), the kernel may be unable to serve the network file through its own cache.For server configurations that are vulnerable to these problems, you should disable this feature.
So hopefully this will prevent someone from going through the same headaches I did. Now I have to get busy now that everything is working!
Possibly Related:

The Enable Sendfile Off – Apache Config Headache by Jim, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.



