Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
Developer
Posts: 71
Registered: ‎11-23-2009
My Device: Not Specified
Accepted Solution

Does mds has its own cache?

I am asking this particular question for an audio streaming app which I am working on.

I am making a http request to a server which contains an audio file of around 5mb. So it takes a considerable amount of time to return a response. And as I request bigger files the response time gets on increasing.

So basically I am getting a very delayed start. There is no problem in buffering and playing the file.

If mds does have a cache, any idea what can I do to get a better response time?

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Does mds has its own cache?

Hypotheses:

 

1. The BlackBerry first downloads the whole 5MB of the response, and then lets your application read it as a stream.

 

2. The MDS first downloads the whole 5MB of the response, and then streams it to your BlackBerry. Compared to case #1 above, you should be able to read your stream a bit earlier, unless it's the MDS <-> web server connection that is the bottleneck.

Developer
Posts: 71
Registered: ‎11-23-2009
My Device: Not Specified

Re: Does mds has its own cache?

Right now I m using the mds simulator to test. But it does take a time of around 2minutes to start downloading/buffering a file of 5mb or greater.

Can u clarify a bit more on this issue?

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Does mds has its own cache?

Not really. I can only suggest that you check whether the data is buffered somewhere. For example, you could avoid the device-side HTTP buffering (if it happens at all), by establishing a TCP connection (via the MDS) to your server, issuing the HTTP request via the TCP connections, and checking how quickly you start receiving the response (you don't have to actually parse it for this test).

Developer
Posts: 71
Registered: ‎11-23-2009
My Device: Not Specified

Re: Does mds has its own cache?

Thanks a lot. That works. Now I get an instant start.

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: Does mds has its own cache?

Interesting. I suppose this really means that all 5MB of the response were buffered in the lower network layers on the BlackBerry before your application got any of the data...

Developer
Posts: 71
Registered: ‎11-23-2009
My Device: Not Specified

Re: Does mds has its own cache?

[ Edited ]

The data transfer keeps on happenin as the application progresses. But I dont have to wait longer for a http response:200.

Earlier it was like the bigger the file the longer the response and then the actual data transfer to my app started. But now the response time is normal like any other url i.e a few seconds.