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.
Robert J. (Guest)
on 2007-03-20 21: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
Eden L. (Guest)
on 2007-03-21 03:17
(Received via mailing list)
On Mar 21, 3:30 am, "S. Robert J." <removed_email_address@domain.invalid> 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.