# Is there anyway to make Rails NOT cache?

**URL:** <https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998>\
**Category:** Rails\
**Created:** [April 17, 2006, 9:56pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998 "2006-04-17T21:56:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 17, 2006, 9:56pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/1 "2006-04-17T21:56:42Z")

</div>

Is there anyway to make Rails NOT cache? I’m getting caching in the  
browser and the server.

I have to restart Lighttpd after every view change to see the results.

Thanks,  
phill

---

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 17, 2006, 10:00pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/2 "2006-04-17T22:00:18Z")

</div>

Phillip Novess wrote:

> Is there anyway to make Rails NOT cache? I’m getting caching in the  
> browser and the server.
> 
> I have to restart Lighttpd after every view change to see the results.
> 
> Thanks,  
> phill

Are you doing development at this point? If so, you really don’t want to  
be using lighttpd - good old webrick will do the trick.

If script\server is running lighttpd and causing trouble, do  
“script\server webrick” instead.

---

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 17, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/3 "2006-04-17T22:12:38Z")

</div>

On Monday 17 Apr 2006 21:00, Bryan D. wrote:

> Are you doing development at this point? If so, you really don’t want to  
> be using lighttpd - good old webrick will do the trick.

I’m developing using Lighttpd and it’s great - no caching problem at  
all.  
Can’t say I ever noticed one?

Surely it can’t be the default behaviour, otherwise why would support  
for it  
have been added if it was unusable because of caching issues? Sounds  
like  
the culprit might be something else (eg. wrong configuration settings)  
to me.

> If script\server is running lighttpd and causing trouble, do  
> “script\server webrick” instead.

Though webrick does indeed do the job perfectly OK for development  
purposes.

~Dave

–

Dave S.  
Rent-A-Monkey Website Development

> **[Tree Removal Service For Home & Businesses in Salt Lake City, UT](https://www.rentamonkey.com/)**
>
> Rent A Monkey Tree Service provides the safest, highest-quality tree removal for Salt Lake City, UT homes and businesses. Request a service today!

PGP Key: [http://www.rentamonkey.com/pgpkey.asc](http://www.rentamonkey.com/pgpkey.asc)

---

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 17, 2006, 10:19pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/4 "2006-04-17T22:19:50Z")

</div>

Dave S. wrote:

> Surely it can’t be the default behaviour, otherwise why would support  
> for it  
> have been added if it was unusable because of caching issues? Sounds  
> like  
> the culprit might be something else (eg. wrong configuration settings)  
> to me.

Oh yeah - make sure you’re not in production mode. That would certainly  
cause problems.

---

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 17, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/5 "2006-04-17T22:22:08Z")

</div>

There’s stuff abt this in the Agile book, and IIRC it’s pretty  
flexible/powerful, but I don’t recall the specifics off the top of my  
head (sorry). Google it with site:api.rubyonrails.com in the search,  
tho, because it’s definitely in there.

Giles

On 4/17/06, Dave S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> me.  
> Dave S.  
> Rent-A-Monkey Website Development  
> [http://www.rentamonkey.com/](http://www.rentamonkey.com/)
> 
> PGP Key: [http://www.rentamonkey.com/pgpkey.asc](http://www.rentamonkey.com/pgpkey.asc)
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Giles B.  
[http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)

---

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 18, 2006, 1:09am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/6 "2006-04-18T01:09:15Z")

</div>

If your Samba server is misconfigured and not updating timestamps on  
files, then fix the configuration of your Samba server.

Or better yet, don’t develop by editing files on a remote fileshare. 😉

Phillip Novess wrote:

> Thanks for all the responses.
> 
> I believe I’m in development mode. At least the lighttpd.conf file has  
> the RAILS\_ENV set to development.
> 
> The cache of the views I know was mentioned in the docs. I remember  
> something about the mod time is compared to render time to determine  
> whether it should be compiled. However, I believe that when I edit  
> files via Samba on my Mac the mod time is n’t updated correctly and  
> thus never gets recompiled until I restart.
> 
> The other caching problem is the cache in my browser. In PHP I use to  
> set the headers for no-pragma cache. How do you do this in Rails? My  
> browser is definitely caching.
> 
> Thanks,  
> phill
> 
> On Apr 17, 2006, at 2:21 PM, Giles B. wrote:
> 
> There’s stuff abt this in the Agile book, and IIRC it’s pretty  
> flexible/powerful, but I don’t recall the specifics off the top of my  
> head (sorry). Google it with site:api.rubyonrails.com in the search,  
> tho, because it’s definitely in there.
> 
> Giles

---

<div class="post-metadata">

**Author:** ![Phillip\_Novess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/edb3f5/32.png) [@Phillip\_Novess](https://www.ruby-forum.com/u/Phillip_Novess)\
**Post date:** [April 18, 2006, 12:19am UTC](https://www.ruby-forum.com/t/is-there-anyway-to-make-rails-not-cache/93998/7 "2006-04-18T00:19:07Z")

</div>

Thanks for all the responses.

I believe I’m in development mode. At least the lighttpd.conf file has  
the RAILS\_ENV set to development.

The cache of the views I know was mentioned in the docs. I remember  
something about the mod time is compared to render time to determine  
whether it should be compiled. However, I believe that when I edit  
files via Samba on my Mac the mod time is n’t updated correctly and  
thus never gets recompiled until I restart.

The other caching problem is the cache in my browser. In PHP I use to  
set the headers for no-pragma cache. How do you do this in Rails? My  
browser is definitely caching.

Thanks,  
phill

On Apr 17, 2006, at 2:21 PM, Giles B. wrote:

There’s stuff abt this in the Agile book, and IIRC it’s pretty  
flexible/powerful, but I don’t recall the specifics off the top of my  
head (sorry). Google it with site:api.rubyonrails.com in the search,  
tho, because it’s definitely in there.

Giles

On 4/17/06, Dave S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> for it  
> purposes.
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Giles B.  
[http://www.gilesgoatboy.org](http://www.gilesgoatboy.org)

* * *

Rails mailing list  
removed\_email\_address@domain.invalid  
[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
