Spring @Cacheable default TTL

后端 未结 5 826
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-14 14:09

I generally use the @Cacheable with a cache config in my spring-boot app and set specific TTL (time to live) for each cache.

I recently inherited a spring b

5条回答
  •  -上瘾入骨i
    2021-02-14 14:53

    The cache will never expire by default. If we need to set expire time we have to use the below properites key. If the value will is the 10000ms, the cache will expire after 1 minute.

    # Entry expiration. By default, the entries never expire.
    spring.cache.redis.time-to-live=10000ms
    

提交回复
热议问题