More Performance in Cancancan
If you use Ruby On Rails, you probably % 90 know Cancancan gem when you need some authorization and ability. Generally, in the first times experiences everything might be easy. When you start a basic application everything very fast and basic in Rails application. When you added some modules and features can be a little hard to manage your application. After 1 year, if your company or your application still living, you start to think of Rails application performance. You start to fix N+1 problems. You start to improve Active Record Queries. I am seeing to hear your words, why this request takes 5 seconds. :) You start to use the caching mechanism. (For Rails caching https://guides.rubyonrails.org/caching_with_rails.html ). Run queries by controls and paths And if you start to think, why there are a lot of DB Queries in logs. If you use Cancancan gem, you need caching role queries and some (if) cases according to by request paths, controllers. I’ll try to inform y...