Method | Description | |
---|---|---|
DiskCacheManager ( string rootPath, bool persistMode = true ) : System |
创建磁盘缓存管理器对象
|
|
Dispose ( ) : void |
释放所有资源,删除文件夹
|
|
GetCachePolicy ( string cacheKey ) : CachePolicyItem |
获取缓存策略对象
|
|
ReadStream ( string cacheKey ) : Task |
读取一个流
|
|
Remove ( string cacheKey ) : void | ||
SetCachePolicy ( string cacheKey, CachePolicyItem cachePolicy ) : void |
设置缓存策略对象
|
|
ValidateCacheKey ( string cacheKey ) : string | ||
WriteStream ( string cacheKey, |
||
WriteStream ( string cacheKey, byte data ) : Task |
Method | Description | |
---|---|---|
AssignCacheDirectory ( ) : void |
分配一个新的缓存目录(一般用于清除缓存)
|
|
Initialize ( ) : void | ||
ReadStream ( |
||
WriteStream ( |
将数据写入文件流
|
public DiskCacheManager ( string rootPath, bool persistMode = true ) : System | ||
rootPath | string | 缓存文件存放的路径 |
persistMode | bool | 持久模式,在此模式下,重启后将尽可能的使用原来的缓存目录 |
return | System |
public GetCachePolicy ( string cacheKey ) : CachePolicyItem | ||
cacheKey | string | 缓存键 |
return | CachePolicyItem |
public ReadStream ( string cacheKey ) : Task |
||
cacheKey | string | 缓存键 |
return | Task |
public SetCachePolicy ( string cacheKey, CachePolicyItem cachePolicy ) : void | ||
cacheKey | string | |
cachePolicy | CachePolicyItem | |
return | void |
public ValidateCacheKey ( string cacheKey ) : string | ||
cacheKey | string | |
return | string |
public WriteStream ( string cacheKey, |
||
cacheKey | string | |
data | ||
return | Task |
public WriteStream ( string cacheKey, byte data ) : Task | ||
cacheKey | string | |
data | byte | |
return | Task |