Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
caijf committed May 15, 2024
1 parent 0dd5050 commit 55f51e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pnpm add cache2
```typescript
import { Cache } from 'cache2';

const myCache = new Cache(options);
const myCache = new Cache(options); // 默认命名空间为 'default',等同于 new Cache('default', options)

myCache.set(key, value, ttl?);
myCache.get(key);
Expand Down Expand Up @@ -75,6 +75,8 @@ local.get('foo');
// undefined
```
<mark>**⚠️ 注意:同一个命名空间的缓存是共享的。意味着命名空间名称相同的情况下,不同实例之间共用同一份缓存数据。建议自定义命名空间名称,避免不同实例的缓存数据冲突**</mark>
## Cache 配置项
| 参数 | 说明 | 类型 | 默认值 |
Expand Down

0 comments on commit 55f51e3

Please sign in to comment.