# Passenger caching in development mode, wtf?

**URL:** <https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544>\
**Category:** Rails\
**Created:** [April 15, 2009, 4:24am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544 "2009-04-15T04:24:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 15, 2009, 4:24am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/1 "2009-04-15T04:24:12Z")

</div>

Hi all,  
I updated an application to Rails 2.3.2(and ruby 1.9.1) and installed  
Passenger, after learning that it turns production mode on by default, i  
changed that to development mode. Logs are correctly being saved to  
development.log so i should definately be in development mode, right?

Well NO! Any change to my code has to be followed by a restart of the  
application due to some caching that I dont want.

Now that they are removing CGI support too, just how the hell am I  
supposed to be making a website in development mode without having to  
restart 500 times a day???

Thanks  
Petr

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 15, 2009, 5:17am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/2 "2009-04-15T05:17:43Z")

</div>

I just tested with Ruby 1.8 and its the same behaviour.

An clues people?

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 15, 2009, 6:08am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/3 "2009-04-15T06:08:22Z")

</div>

perhaps here:

[http://www.modrails.com/documentation/Users%20guide.html#RailsSpawnMethod](http://www.modrails.com/documentation/Users%20guide.html#RailsSpawnMethod)

but can’t you use mongrel for development and passenger for production?

Petr J. wrote:

> I just tested with Ruby 1.8 and its the same behaviour.
> 
> An clues people?

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 15, 2009, 10:13am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/4 "2009-04-15T10:13:01Z")

</div>

On Apr 15, 5:58 am, Petr J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> This makes no difference. The problem is with mongrel is that I need the  
> devel applications to be accessible even when im not developing, ie.  
> client review. And id need to make a start up script in case i reboot  
> the server to make all the mongrels start up. Its just hassle.  
> dispatch.cgi/fcgi was ideal for simple setup in development mode where  
> speed usually doesnt matter.

Well the passenger docs imply that it should all just work:

“If you set RailsEnv development in your Apache configuration, then  
Rails will automatically reload your application code after each  
request”

You might want to ask the passenger mailing list or similar why it  
doesn’t seem to be working for you.

Fred

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 15, 2009, 6:58am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/5 "2009-04-15T06:58:31Z")

</div>

This makes no difference. The problem is with mongrel is that I need the  
devel applications to be accessible even when im not developing, ie.  
client review. And id need to make a start up script in case i reboot  
the server to make all the mongrels start up. Its just hassle.  
dispatch.cgi/fcgi was ideal for simple setup in development mode where  
speed usually doesnt matter.

PP Junty wrote:

> perhaps here:
> 
> [Phusion Passenger users guide index](http://www.modrails.com/documentation/Users%20guide.html#RailsSpawnMethod)
> 
> but can’t you use mongrel for development and passenger for production?
> 
> Petr J. wrote:
> 
> > I just tested with Ruby 1.8 and its the same behaviour.
> > 
> > An clues people?

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 15, 2009, 4:01pm UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/6 "2009-04-15T16:01:12Z")

</div>

I’ve not tried this, but as a last resort you might try: touch  
tmp/always\_restart.txt in your applicationâ€™s root folder.  
Cheers–

Charles

On Wed, Apr 15, 2009 at 3:11 AM, Frederick C. \<

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 16, 2009, 4:36am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/7 "2009-04-16T04:36:39Z")

</div>

Ok i resolved it, after hours of trying to figure it out, i noticed that  
the cause is having config.threadsafe! enabled in development mode. For  
some reason it causes caching to get enabled. This option should be  
documented better.

Petr

---

<div class="post-metadata">

**Author:** ![petrjanda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@petrjanda](https://www.ruby-forum.com/u/petrjanda)\
**Post date:** [April 16, 2009, 10:56am UTC](https://www.ruby-forum.com/t/passenger-caching-in-development-mode-wtf/165544/8 "2009-04-16T10:56:27Z")

</div>

On Apr 16, 3:36 am, Petr J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Ok i resolved it, after hours of trying to figure it out, i noticed that  
> the cause is having config.threadsafe! enabled in development mode. For  
> some reason it causes caching to get enabled. This option should be  
> documented better.

The reloading mechanism in rails isn’t threadsafe, so threadsafe!  
among other things turns it off (mentioned among other places in  
[Configuring Rails Applications — Ruby on Rails Guides](http://guides.rubyonrails.org/configuring.html))

Fred
