question on the inner workings of ktor: if you mak...
# ktor
n
question on the inner workings of ktor: if you make a request and then another identical request whilst the first one is still awaiting a response does the second request also await the outcome of the first request or does it generate another network round trip?
d
I'd imagine that by default those would be treated as two separate requests. I'm guessing you would need some sort of caching mechanism in the pipeline to only make single request.
n
By caching mechanism do you mean just adding the HttpCache plugin?
d
unsure what that plugin does, guessing no but check docs
n
Nothing in docs
d
so probably not
a
If an endpoint allows caching its responses then you can use the
HttpCache
plugin to cache a response from the first request and have it for the second one without making a network call. However, this depends on when the second request is fired.