title: Spring Cache Evict does not work
body: <p>Hi I have problem with clean cache when method is executed. 
  Here is my configuration and caches methods:</p>
  
  <pre><code>@Configuration
  @EnableCaching
  @AutoConfigureAfter(value = {MetricsConfiguration.class, DatabaseConfiguration.class})
  @Profile("!" + Constants.SPRING_PROFILE_FAST)
  public class CacheConfiguration {
  
      private final Logger log = LoggerFactory.getLogger(CacheConfiguration.class);
      public static final String STOCK_DETAILS_BY_TICKER_CACHE = "stockDetailsByTickerCache";
      public static final String RSS_NEWS_BY_TYPE_CACHE = "rssNewsByTypeCache";
  
      @Bean
      public CacheManager cacheManager() {
          SimpleCacheManager cacheManager = new SimpleCacheManager();
          List&lt;Cache&gt; caches = new ArrayList&lt;Cache&gt;();
          caches.add(new ConcurrentMapCache(STOCK_DETAILS_BY_TICKER_CACHE));
          caches.add(new ConcurrentMapCache(RSS_NEWS_BY_TYPE_CACHE));
          cacheManager.setCaches(caches);
          return cacheManager;
      }
  }
  </code></pre>
  
  <p>This method i want to cache:</p>
  
  <pre><code>@Cacheable(cacheNames = CacheConfiguration.RSS_NEWS_BY_TYPE_CACHE, key = "#type")
      public ResponseEntity&lt;List&lt;NewsDetailsDTO&gt;&gt; getLatestNewsMessageByType(RssType type) {
          Pageable pageable = new PageRequest(0, 5, Sort.Direction.DESC, "createdDate");
          List&lt;NewsMessage&gt; latestNewsMessage = newsMessageRepository.findByType(type, pageable).getContent();
          return new ResponseEntity&lt;List&lt;NewsDetailsDTO&gt;&gt;(mapToDTO(latestNewsMessage), HttpStatus.OK);
      }
  </code></pre>
  
  <p>On execution of this method i would like to clean cache by type:</p>
  
  <pre><code>@CacheEvict(cacheNames={CacheConfiguration.RSS_NEWS_BY_TYPE_CACHE}, beforeInvocation = true, key = "#news.type")
      public void save(NewsMessage news) {
          newsMessageRepository.save(news);
      }
  </code></pre>
  
  <p>And NewsMessage object looks like:</p>
  
  <pre><code>@Entity
  @Table(name = "NEWS_MESSAGE")
  public class NewsMessage extends ChatMessage {
  
      &lt;other fileds&gt;
  
      @NotNull
      @Enumerated(EnumType.STRING)
      private RssType type;
  }
  </code></pre>
  
  <p>The cache thing works fine, by the first time there is a query to DB by second and next the data is fetch from cache. Problem is when I update data the @CacheEvict does not clean the cache. I was trying to clean all cache using this annotation: 
  @CacheEvict(cacheNames={CacheConfiguration.RSS_NEWS_BY_TYPE_CACHE}, allEntries = true)
  But it also does not work. Could you help me?</p>