Card 07/ 07

RecapDifficulty: Advanced1 min

What This Topic Established

@EnableCaching turns the mechanism on; @Cacheable skips the method on a cache hit, @CachePut always runs and refreshes the cache, @CacheEvict removes an entry — all three verified against a real call counter. The cache key is built from the method's own arguments by default, so different arguments never collide.

@Cacheable plus @CacheEvict is cache-aside; plus @CachePut is closer to write-through. The default cache provider is real and genuinely fine for one instance — and silently wrong the moment there's more than one, since each instance holds its own, uncoordinated copy.