Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
2 Posts

Hi, I am doing page caching for a page that contains list of posts submitted by users. The cache is expired when a new post is submitted. However when a new post is submitted the controller redirects to the page with the list but with "stale data" instead of a new list of posts. The only way I can get a new list is to refresh the page. Is there a way to ensure that a fresh set of posts are shown once a new post is submitted and is redirected? Thanks.

Hi Richard,

Maybe you can check if the page you are redirecting to contains the correctly expired cache key as in..

'yourcontroller', :action => 'youraction', :key => 'yourkey' do ... end -%>

If you managed to expire the certain key when a new post was submitted, then make sure that that same key is the one used in the page that displays the list.

well seasoned senior ruby on rails de...
Forum Rating: 100
Sign In To Rate Post
2 Posts
Login to add your message