How to prevent making a query, if id is removed from ids list that is used as cache key
Hi!
In our app we've got queries that often involve passing lists of ids to various API endpoints. In most cases the response returns a list of data for each item separately, there's no aggregated data that depends on the list of all passed ids. The issue we're having is that if we already have data for items with ids e.g. 1, 2 and 3 and someone removes an item with id 2 from the list, we make a new query for items with ids 1 and 3, even though we already have this data, only because the list of ids has changed and it's used as a part of the cache key.
Is there some easy and efficient way to figure out that we already have this data and not make a new request?
In our app we've got queries that often involve passing lists of ids to various API endpoints. In most cases the response returns a list of data for each item separately, there's no aggregated data that depends on the list of all passed ids. The issue we're having is that if we already have data for items with ids e.g. 1, 2 and 3 and someone removes an item with id 2 from the list, we make a new query for items with ids 1 and 3, even though we already have this data, only because the list of ids has changed and it's used as a part of the cache key.
Is there some easy and efficient way to figure out that we already have this data and not make a new request?