Do you know a Spring Boot specific soltution to this scenario?
I followed the steps to implement Spting's @Cacheable
but it is not working for me although I reduced the code to the simplest example:
@Controller
public class TestController {
@RequestMapping("/test")
public String testView(){
expensiveMethod();
return "test";
}
@Cacheable("ones")
public void expensiveMethod(){
System.out.println("Cache is not being used");
}
}
Every request to localhost:8080/test
prints the string, not just the first one.
I annotated my main class with @EnableCaching