Backport of the Mongoid 4 QueryCache for Mongoid 3.