Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cache REST responses, Spring For Android

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.

like image 380
Ruzard Avatar asked Aug 24 '12 12:08

Ruzard


People also ask

How to cache rest API response in java?

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.

How to implement Caching in spring boot rest API?

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.


1 Answers

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.

like image 129
Snicolas Avatar answered Oct 05 '22 17:10

Snicolas