title: How to cache REST API response in java
body: <p>I am building an app in java.I hit api more than 15000 times in loop and get the response ( response is static only )</p>
  
  <p>Example</p>
  
  <pre><code>**
    username in for loop   
    GET api.someapi/username
    processing
    end loop
  **
  </code></pre>
  
  <p>It is taking hours to complete all the calls. Suggest me any way (any cache technology) to reduce the call time.</p>
  
  <p>P.S :</p>
  
  <blockquote>
    <p>1) i am hitting api from java rest client(Spring resttemplate) </p>
    
    <p>2) that api i am hitting is the public one, not developed by me </p>
    
    <p>3) gonna deploy in heroku</p>
  </blockquote>