Rails Fragment Caching with Permissions Discussion
Discussion for
Rails Fragment Caching with Permissions
I think simply caching based off of a simple key such as
Rails.cache.fetch("post-#{post.id}-#{post.owner?(current_user)}") do .... end
Would be better as you would only get a max of two fragment caches per post and not need the extra js or bloat the clients browser with unnecessary html. 🤔