Active Record Query Caching with Sinatra

Sinatra is awesome, but Rails has a lot of useful features. One of those is Active Record's Query Caching. I never realized how useful this is until I started to optimize Sinatra apps and felt its absence. Here is a simple way to enable active record query caching in Sinatra.