Since caching is not implemented yet in new version of AMS (0.9.0) because of rewrite you can use Rails built in caching functionality.

def index
    trips = Trip.all
    
    json = cache ['v1', trips] do
      render_to_string json: trips
    end
    
    render json: json
end

It won’t work in development by default because caching is disabled for development mode.

You can copy config line from your production.rb to development.rb just to test if it’s working:

config.action_controller.perform_caching = true