to only send a request to rails when a user is logged in and display a
cached page when the user is not logged in. The problem is that when a
logged in user views a page that is to be cached rails then caches the
page with the content that is displayed to a logged in user, this will
then be displayed when a user who is not logged in views the page. So
what I would like to be able to do is to only page cache a page when a
user is not logged in.
Does anyone have any ideas about how I could do this?
page with the content that is displayed to a logged in user, this will
then be displayed when a user who is not logged in views the page. So
what I would like to be able to do is to only page cache a page when a
user is not logged in.
Does anyone have any ideas about how I could do this?
You should use action caching for this. It lets you run any
authorization before filters before checking for the cache. It’s not
as fast as page caching, but authenticated pages need to hit rails to
run the authorization code.