views:

24

answers:

2

I am running Rails 3 and Passenger 2 and I don't know why but my page is still cached despite having this configuration (in one of my virtual hosts):

<VirtualHost *:80>
    ServerName railstut.dev
    ServerAlias *.railstut.dev
    DocumentRoot "/home/ygamretuta/dev/railstut/public/"
    RailsEnv "development"

    <Directory "/home/ygamretuta/dev/railstut/">
        AllowOverride all
        Options -MultiViews
    </Directory>
</VirtualHost>

I tried it in Firefox with the browser cache disabled (via web developer plugin) so I don't think there's a problem with the browser cache. I always need to restart the server to see the changes made (even with some minor changes like replacing a text).

What could be the problem?

EDIT Passenger seems to be setting the environment to production despite there being a RailsEnv config option.

EDIT Passenger runs on production environment as seen on some of my pages accessing the DB. It looks for the database name configured in the production section in the database.yml file.

A: 

If you have existing file cache page cache entries, they will supercede the dynamic request even after restarting. You should clear your tmp or cache directories if you have ever used the file store for caching.

Winfield
I will look into this but do you know how I can force Passenger to see the rails environment as development? Because when I go to some pages fetching data from a DB, it fetches data from the production database server with the above configuration
Ygam