Forum: Ruby on Rails Unwanted caching

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
969047aea93d01a9cc636e9867f4ec0f?d=identicon&s=25 Serafino Picozzi (serpico)
on 2011-05-30 13:43
Hi,

I'm experiencing a strange problem with my rails app (I'm using rails
2.3.8).
In a sidebar I want to show, on every page, a list of the 5 latest news
inserted into the website. In my layout therefore I have someting like:

<%= render :partial => "/news/news", :collection => News.latest %>

The problem is that in production mode (I'm using passenger) whenever I
insert a news, it doesn't show up until I restart the server or wait
some time between 30-60 minutes.
Executing News.latest on a production console shows the recently
inserted news, while on the page I still can't see it, therefore I'm
pretty sure it's something related to passenger or apache.

I currently have caching disabled on the rails app, and obviously I
already tried clearing the browser cache.

Thanks in advance for your help.

P.S: when executing the query from a controller the news is displayed
correctly. This is even more obvious when I can't see the news on the
sidebar but I can see it in the news archive page.
This topic is locked and can not be replied to.