Is it ok to call .newBuilder() for okhttp for each...
# squarelibraries
t
Is it ok to call .newBuilder() for okhttp for each calls for a specific part of an app or I should try to cache it at an higher level ?
j
It’s okay
What’s changing per-request?
t
Just the timeouts for a specific tag extractor stuff that can trigger slow calls on some providers. Since I don't need the extended timeouts for all the other calls, doing it at the extractor side is nice. Thanks for confirming.
y
Interceptors can override per call. If it's cleaner that way
t
In this case the 2 modules are not aware of each other's so the okhttp provider can't add the interceptor and that's why I prefer that the receiver part can override timeouts instead of the provider providing 2 different okhttp for different purpose.
1