title: Spring Boot Custom Cache TTL
body: <p>I am new to cache technology in spring boot where I am using <code>@cache</code> in my project. Now I have a new requirement where the cache TTL need to be set and that TTL has to extend on key basis. </p>
  
  <p>E.g. if I set a cache expiry time as 5 minutes, before the cache is getting expired it has to check whether the incoming key is present in the cache or not if it is present in the cache the TTL has to extends for next 5 minutes else the cache should be cleared or evicted and fresh cache should be created.</p>
  
  <p>I hope I am clear with my requirement, please provide me solution with perfect example which suits my requirement. I have referred some links like Ecache custom expiration but I am confused on how to pass the custom expiry on key basis.</p>
  
  <p><a href="http://www.ehcache.org/documentation/3.1/expiry.html" rel="nofollow noreferrer">http://www.ehcache.org/documentation/3.1/expiry.html</a></p>
  
  <p>Thanks in advance for guiding me,<br>
  Chaitanya </p>