Ruby on Rails How to make a different cache, based on if they are logged in

Basically add get_cache to your application helper file, then when you do the cache, put get_cache for the key, the first option, then use the skip digest option. Don’t remember what the digest is.

In the get_cache, return a different string based on if they are logged in or not, you can add “guest” to the one if they aren’t logged in.

Clearing will be a pain, unless you cheat, and use “Rails.cache.clear”.

Also if you use a pagination gem, you’ll need to make each page have a unique key. The easiest way is to add the page number to the key.