top of page

SpringBoot & Caching

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Nov 4, 2023
  • 1 min read
ree

ree

ree

  1. we need to enable caching as below- we could write our configuration class and enable cacjing or we can enable caching in springboot main application class

  2. springboot starter cache in classpath

ree

2.

Below are the sample cache annotation which we can use /map for the fetching record


@Cacheable ---

used for the fetch operation.it always check first in cache if found return data else hit db get data,populate cache and return data.

ree

@CachePut

used for update operation.This is always executing body and then update cache.


ree

@CacheEvict

to remove cache information


ree

@Caching -

used to manage multiple cache


ree

@CacheConfig- at class level


ree

 
 
 

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page