Forum: Ruby on Rails Page Caching with clusters and redirect

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.
53a1f0aba6f0489d49f5e6fc3df323fa?d=identicon&s=25 Robert James (robertjames)
on 2007-03-20 20:31
(Received via mailing list)
1. What's the behavior of caches_pages when an action returns a
redirect?
I'd like to only cache the page if the action renders, but *not* cache
the redirect

2. Any solution for using caching with a cluster of web servers? The
sweepers won't fire on the other web servers
8bc543795b502900b5333aea73ad5533?d=identicon&s=25 Eden Li (edenli)
on 2007-03-21 02:17
(Received via mailing list)
On Mar 21, 3:30 am, "S. Robert James" <srobertja...@gmail.com> wrote:
> 1. What's the behavior of caches_pages when an action returns a
> redirect?
> I'd like to only cache the page if the action renders, but *not* cache
> the redirect

It will serve the cached page straight away, no matter what, until the
cache has expired.  If you need to do redirects, use action-level
caching with a before_filter.

> 2. Any solution for using caching with a cluster of web servers? The
> sweepers won't fire on the other web servers

One solution is to use action caching everywhere and then use a
central memcached server as your fragment store.  Whenever you expire
an action, it'll get expired on that server.
This topic is locked and can not be replied to.