Add caching to c_backend.