Skip to content
ivar edited this page Sep 12, 2010 · 3 revisions

Sometimes when using passenger for Rails in development mode behind Apache, my static resources get cached by the server. How do I disable this behaviour ?

If a file exists in /public Passenger passes the request to Apache to handle. Apache is often setup to cache these files by default, so any modifications to javascript or css are not immediately reflected, regardless of development mode. In order to turn off this caching, you must add the following directives to your application declaration

EnableMMAP Off
EnableSendfile Off

so for example :

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName www.example.com
    DocumentRoot /webapps/example/current
    EnableMMAP Off
    EnableSendfile Off
</VirtualHost>

Should work.