I'm making an Ajax call to a route that performs an entityQuery. I know that when a node is added, it will change the results of that entityQuery, but until then, I want the route to return cached data so it doesn't have to perform the full query every time. What is the fastest way to do this?
Is there a way to put a cache tag on the route itself, that I can invalidate on node creation?
Should I do a $cache = \Drupal::cache()->get($cid) kind of thing in the route itself?
Thank you for reading.