Add cache prototype. Update rails. Fix pagination.