views:

12

answers:

0

I'm writing a thick client for a REST based web service (for Android). I'd like to cache results that I got from this service, and I'd like to store these results in an SQLite DB. There's a single table in this db, every record represents a past transaction with the web service. In its schema, there's an attribute for: the http reponse code, the http response body, the time I got the reponse, and the URI that I used to invoke te web service (I only handle GET requests).

My question is: could you recommend a better way to determine if a request with a certain URI is present in the cache DB other then just compare every record's request URI with the one I'm about the get from the web service? This solution doesn't seem to be too efficient. (the URIs tend to be quite long)

Thanks.