Browse Source

Update cache document

pull/7523/head
liangshiwei 5 years ago
parent
commit
5dfe8519d0
  1. 7
      docs/en/Caching.md
  2. 12
      docs/zh-Hans/Caching.md
  3. 1
      docs/zh-Hans/Redis-Cache.md
  4. 4
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs

7
docs/en/Caching.md

@ -242,12 +242,15 @@ In addition, all of the `IDistributedCache<TCacheItem>` (and `IDistributedCache<
## Batch Operations
ABP's distributed cache interfaces provide methods to perform batch get/set methods those improves the performance when you want to get or set multiple cache items in a single method call.
ABP's distributed cache interfaces provide methods to perform batch methods those improves the performance when you want to batch operation multiple cache items in a single method call.
* `SetManyAsync` and `SetMany` methods can be used to set multiple values to the cache.
* `GetManyAsync` and `GetMany` methods can be used to retrieve multiple values from the cache.
* `GetOrAddManyAsync` and `GetOrAddMany` methods can be used to retrieve multiple values and set missing values from the cache
* `RefreshManyAsync` and `RefreshMany` methods can be used to resets the sliding expiration timeout of multiple values from the cache
* `RemoveManyAsync` and `RemoveMany` methods can be used to remove multiple values from the cache
> These are not standard methods of the ASP.NET Core caching. So, some providers may not support them. They are supported by the [ABP Redis Cache integration package](Redis-Cache.md). If the provider doesn't support, it fallbacks to `SetAsync` and `GetAsync` methods (called once for each item).
> These are not standard methods of the ASP.NET Core caching. So, some providers may not support them. They are supported by the [ABP Redis Cache integration package](Redis-Cache.md). If the provider doesn't support, it fallbacks to `SetAsync` and `GetAsync` ... methods (called once for each item).
## Advanced Topics

12
docs/zh-Hans/Caching.md

@ -192,6 +192,18 @@ public class BookService : ITransientDependency
}
````
## 批量操作
ABP的分布式缓存接口定义了以下批量操作方法,当你需要在一个方法中调用多次缓存操作时,这些方法可以提高性能
* `SetManyAsync``SetMany` 方法可以用来设置多个值.
* `GetManyAsync``GetMany` 方法可以用来从缓存中获取多个值.
* `GetOrAddManyAsync``GetOrAddMany` 方法可以用来从缓存中获取并添加缺少的值.
* `RefreshManyAsync``RefreshMany` 方法可以来用重置多个值的滚动过期时间.
* `RemoveManyAsync``RemoveMany` 方法呆以用来删除多个值.
> 这些不是标准的ASP.NET Core缓存方法, 所以某些提供程序可能不支持. [ABP Redis集成包](Redis-Cache.md)实现了它们. 如果提供程序不支持,会回退到 `SetAsync``GetAsync` ... 方法(循环调用).
### DistributedCacheOptions
TODO

1
docs/zh-Hans/Redis-Cache.md

@ -0,0 +1 @@
TODO...

4
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/IDistributedCache.cs

@ -258,7 +258,7 @@ namespace Volo.Abp.Caching
);
/// <summary>
/// Refreshes multiple cache items.
/// Refreshes the cache value of the given keys, and resets their sliding expiration timeout.
/// Based on the implementation, this can be more efficient than setting multiple items individually.
/// </summary>
/// <param name="keys">The keys of cached items to be retrieved from the cache.</param>
@ -268,7 +268,7 @@ namespace Volo.Abp.Caching
bool? hideErrors = null);
/// <summary>
/// Refreshes multiple cache items.
/// Refreshes the cache value of the given keys, and resets their sliding expiration timeout.
/// Based on the implementation, this can be more efficient than setting multiple items individually.
/// </summary>
/// <param name="keys">The keys of cached items to be retrieved from the cache.</param>

Loading…
Cancel
Save