# How can I stop view caching?

**URL:** <https://www.ruby-forum.com/t/how-can-i-stop-view-caching/56829>\
**Category:** Rails\
**Created:** [April 4, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/how-can-i-stop-view-caching/56829 "2006-04-04T17:57:44Z")\
**Posts on this page:** 3\
**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 4, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/how-can-i-stop-view-caching/56829/1 "2006-04-04T17:57:44Z")

</div>

Does anybody know how to stop the caching for views?

I’m using Lighttpd with fcgi. Every time I make a change to the HTML in  
a view, I have to restart lighttpd before I can see the result of the  
change. I understand that the page is is compiled until it sees the  
modification date has changed. However, I am working on a Linux machine  
and editing the files on a Samba mount from my Mac OS X workstation. It  
doesn’t look like the mod dates are being updated. So the result is a  
caching problem.

Anybody have this problem? Know how to fix it?

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 5, 2006, 3:30pm UTC](https://www.ruby-forum.com/t/how-can-i-stop-view-caching/56829/2 "2006-04-05T15:30:04Z")

</div>

If you are in running in an development environment, then page  
caching should be disabled. Are you sure it’s not your browser doing  
the caching? Also, forgive me the obvious question, but why not do  
all your development locally on your linux box, and move it to the  
server when you’ve got it ready?

-Derrick

---

<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 5, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/how-can-i-stop-view-caching/56829/3 "2006-04-05T15:48:02Z")

</div>

Why are you doing development with FCGI? That makes it sound like you’ve  
set things up to run in production mode, which has caching turned on by  
default and would need to be turned off in  
config/environment/production.rb … but really if this is the case  
you should be developing in development mode, which has caching turned  
off.

Second, as the last respondent noted, why are you editing a live  
application on a remote file share? Wouldn’t it be much easier to  
develop directly on your OS X box with a less-elaborately configured  
webserver that isn’t running an application-caching container like FCGI?

It really sounds like you’re running in production mode, which is pretty  
hard to do by accident, but if you’re certain you’re in development mode  
and this same thing happens when you use WEBrick instead of  
lighttpd+fcgi, maybe it really is the timestamp issue on the files, in  
which case you would need to consult Samba documentation. A  
misconfigured fileserver is beyond the scope of a Rails list. 😉

Phillip Novess wrote:

> Does anybody know how to stop the caching for views?
> 
> I’m using Lighttpd with fcgi. Every time I make a change to the HTML in  
> a view, I have to restart lighttpd before I can see the result of the  
> change. I understand that the page is is compiled until it sees the  
> modification date has changed. However, I am working on a Linux machine  
> and editing the files on a Samba mount from my Mac OS X workstation. It  
> doesn’t look like the mod dates are being updated. So the result is a  
> caching problem.
> 
> Anybody have this problem? Know how to fix it?
> 
> Thanks,  
> Phill
