title: @Caching in spring cache
body: <p>I'm used cache in page list.</p>
  
  <p>I want to 1~5 page cached.</p>
  
  <p>So, </p>
  
  <pre><code>@Cacheable(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, #pageIndex, #pagePerNumber)", condition = "#pageIndex &lt; 5")
  </code></pre>
  
  <p>Keys like:</p>
  
  <pre class="lang-none prettyprint-override"><code>'brandon@[EventChainServiceImpl]0/10'
  
  'brandon@[EventChainServiceImpl]1/10'
  
  'brandon@[EventChainServiceImpl]2/10'
  </code></pre>
  
  <p>So,    </p>
  
  <pre><code>@Caching(evict = {
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 0, 5)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 0, 10)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 0, 25)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 0, 50)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 1, 5)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 1, 10)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 1, 25)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 1, 50)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 2, 5)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 2, 10)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 2, 25)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 2, 50)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 3, 5)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 3, 10)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 3, 25)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 3, 50)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 4, 5)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 4, 10)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 4, 25)"),
      @CacheEvict(value = "cacheData", key = "T(com.insoft.pacific.util.CacheKeyGenerator).cacheKey(#root.targetClass, 4, 50)") })
  </code></pre>
  
  <p>How can I simplify this?</p>