Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用spring boot starter data redis时,如何设置逐出策略?LFU或LRU等?_Spring_Spring Boot_Redis_Spring Data Redis - Fatal编程技术网

使用spring boot starter data redis时,如何设置逐出策略?LFU或LRU等?

使用spring boot starter data redis时,如何设置逐出策略?LFU或LRU等?,spring,spring-boot,redis,spring-data-redis,Spring,Spring Boot,Redis,Spring Data Redis,当通过spring boot将redis用作缓存技术时( 但我无法确定如何设置缓存逐出策略,如-最不常用或最近使用的缓存逐出策略等。 如何以及在何处提供此配置详细信息???您找到答案了吗?:D我也需要这些信息lol@solujic,查看redis.conf。可能无法从Java代码中设置它。 spring.cache.cache-names=cache1,cache2 spring.cache.redis.time-to-live=600000 spring.redis.database=0 #

当通过spring boot将redis用作缓存技术时(

但我无法确定如何设置缓存逐出策略,如-最不常用或最近使用的缓存逐出策略等。

如何以及在何处提供此配置详细信息???

您找到答案了吗?:D我也需要这些信息lol@solujic,查看redis.conf。可能无法从Java代码中设置它。
spring.cache.cache-names=cache1,cache2
spring.cache.redis.time-to-live=600000
spring.redis.database=0 # Database index used by the connection factory.
spring.redis.url= # Connection URL. Overrides host, port, and password. User is ignored. Example: redis://user:password@example.com:6379
spring.redis.host=localhost # Redis server host.