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