Skip to content

patilvishi/springboot-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Spring Boot Caching (@Cacheable, @CachePut, @CacheEvict)

Goal

Learn how to use Spring’s caching abstraction to boost performance by reducing DB calls.


Key Concepts

Annotation Purpose
@Cacheable Caches method result (skips re-execution next time)
@CachePut Updates cache when data changes
@CacheEvict Removes cache entry after deletion

Example Endpoints

POST /api/products
{
  "name": "Laptop",
  "price": 85000
}

GET /api/products/1   # First call hits DB (slow)
GET /api/products/1   # Second call is instant (from cache)
DELETE /api/products/1   # Evicts from cache

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published