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.
Try using Springs Cache Abstraction, docs.spring.io/spring/docs/current/spring-framework-reference/html/cache.html. You can use this abstraction in the method which has the restTemplate call.
If we want to enable cache mechanism in a Spring Boot application, we need to add cache dependency in the pom. xml file. It enables caching and configures a CacheManager.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With