How to cache REST responses, Spring For Android
Asked Answered
C

2

6

The goal is to cache some responses from web service.

I am using Spring for Android framework - http://www.springsource.org/spring-android#documentation to communicate with restful service. As I know I can add caching into application using some module from the common Spring Framework ( http://viralpatel.net/blogs/cache-support-spring-3-1-m1/ ). Am I right that it is not possible to do using just spring-for-android? What is the solution then?

*I don't have any experience in a common Spring.

Chert answered 24/8, 2012 at 12:12 Comment(0)
C
0

So, it was easier to use extra database for caching purposes. I have used these columns: expiration date, request url, request object (hash), response object (serialized).

I have "asked" for cache just before request was sent to server. It was enough to fulfill my goals, if you need extra features probably you need additional columns.

Chert answered 16/12, 2012 at 20:51 Comment(0)
T
1

I am a contributor to RoboSpice. This library offers a nice asynchronous model for network request with caching. We also have a Spring Android Module that you could be interested in.

Tyrannize answered 11/12, 2012 at 7:7 Comment(0)
C
0

So, it was easier to use extra database for caching purposes. I have used these columns: expiration date, request url, request object (hash), response object (serialized).

I have "asked" for cache just before request was sent to server. It was enough to fulfill my goals, if you need extra features probably you need additional columns.

Chert answered 16/12, 2012 at 20:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.