Add caching to graphs_controller