Open crawfoal opened 6 years ago
One other thing is that in production, Rails automatically uses cached SQL queries if the query has already been made during that request. But still, we are making the query once for every page load and it is only needed if the user has just redeemed a prize or logged points. That might be a big enough percentage of the requests that it is not all that helpful to do low level caching so we really should measure this.
This calculation is done multiple times per page load for the user dashboard 😬
We should use the Rails built-in low level caching API and we need to determine if we are okay to use the Rails default cache store. If not I'm thinking the Memcashier Heroku add on is a good option (with the dalli gem, not the old memcached). A couple things to consider when determining which cache store to use:
We should also get some before and after measurements to ensure that the caching is actually helping. Maybe we can start using New Relic.