11-22-2012 05:31 AM
Does blackberry framework use connection reuse for http connection? I use
connectionFactory.getConnection("api.abc.com") . I have noticed that the first call (simple rest call for ex, getting number of unread messages) from my app takes about 4 seconds but all the subsequent calls take less than a second to complete. I have noticed that the same call when made after another call takes less than a second, so I am thinking that blackberry uses http connection reuse. Does anyone have an explanation for this behaviour?
11-22-2012 06:52 AM
I don't believe so.
I think the "subsequent" effect you are seeing is a result of the caching of connection setup processing. For example, I have seen connector open() calls take ages attempting DNS lookups to confirm the URL, which are only going to be required once in a while.
11-22-2012 11:08 AM
that makes sense.
Is there any documentation you are aware of that is available which explains what caching is done during connections?
11-22-2012 12:01 PM
None that I am aware off. For example, it is only with experience that I have figured out that https connections are actuallymade at open time, whereas http connections are only made when you request some input from the connection (e.g. response code).
But in most cases this has not effected the way that I written the apps.