@Target(value=METHOD) @Retention(value=RUNTIME) @Documented public @interface Cacheable
| 限定符和类型 | 可选元素和说明 |
|---|---|
String |
afterCondition
根据返回结果判断是否需要缓存
SpEL表达式,参数为r[0],r[1]...。 |
String |
beforeCondition
根据入参判断是否需要缓存
SpEL表达式,参数为a[0],a[1]...。 |
long |
compressMinSize
缓存结果超过指定最小字节则开启gz压缩。
|
String |
key
生成缓存key的SpEL表达式。
|
long |
ttl
缓存过期时间(单位:毫秒)
非正整数则永不过期。 |
public abstract String key
public abstract String beforeCondition
public abstract String afterCondition
Copyright © 2022. All rights reserved.