1.5.0 • Published 1 month ago
koatty_cacheable v1.5.0
koatty_cacheable
Cacheable for koatty.
Koatty框架的 CacheAble, Cacheable, CacheEvict 支持库
Usage
db.ts in koatty project:
export default {
...
"CacheStore": {
type: "memory", // redis or memory, memory is default
// key_prefix: "koatty",
// host: '127.0.0.1',
// port: 6379,
// name: "",
// username: "",
// password: "",
// db: 0,
// timeout: 30,
// pool_size: 10,
// conn_timeout: 30
},
...
};
used in service:
import { CacheAble, CacheEvict, GetCacheStore } from "koatty_cacheable";
export class TestService {
@CacheAble("testCache") // auto cached
getTest(){
//todo
}
@CacheEvict("testCache") // auto clear cache
setTest(){
//todo
}
test(){
const store = GetCacheStore(this.app);
store.set(key, value);
}
}
1.5.0
1 month ago
1.4.3
4 months ago
1.4.2
4 months ago
1.4.1
9 months ago
1.4.0
1 year ago
1.3.8
1 year ago
1.3.7
2 years ago
1.3.6
2 years ago
1.3.4
2 years ago
1.3.2
2 years ago
1.2.12
3 years ago
1.2.11
3 years ago
1.2.8
3 years ago
1.2.7
3 years ago
1.2.10
3 years ago
1.2.5
3 years ago
1.2.3
3 years ago
1.2.2
3 years ago
1.2.0
3 years ago
1.2.1
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.0
4 years ago