I'm developing an iOS-app that uses an API. The API has a text search, and we've implemented a debouncer to ensure that we don't perform a search every time the user writes a character in the search field. We wait 0.2 seconds after every each character to see if there will come another character. If the user writes "Washingto" and uses 0.205 seconds to type the last "n", we first initiate a search for the first word, and then immediately cancel it after 0.005 seconds. We cancel requests using standard client API (e.g URLSessionTask.cancel for iOS).
This has been working perfectly for a year. But today, we received a warning from our (external) API, saying that we need to stop cancelling our own queries like this. Their reason being that their gateway Apigee doesn't handle it very well, and they receive miles of logs with status code 499.
As far as I can tell, they imply that we have to keep the request and receive the response, meaning more data usage (mobile), more processor (parsing) and thus more battery usage.
Is this "problem" really only resolved like this? I thought we were doing best practice from our clients here, but they claim that Apigee claims that clients shouldn't close connections like this.
Also, I'm not sure which tags to use or where to ask this..