Rails cache optimize

This uses the Rails caching mechanism to optimize database load on the application layer.
These optimizations were initially developed in #112 and rebased to the current staging branch.
or maybe don't want to do this at all because if it's a memory cache it will be clear already