-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CacheManagerOptions): add CacheManagerOptions support configue c…
…ache expiration (#5310) * feat: 增加 CacheManagerOptions 配置类 * feat: 增加 CacheManagerOptions 参数 * feat: 使用 CacheManagerOptions 值代替常量 * doc: 更新缓存时长计算方法 * test: 增加单元测试 * feat: 增加 SetDefaultSlidingExpiration 扩展方法精简代码
- Loading branch information
Showing
6 changed files
with
88 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the Apache 2.0 License | ||
// See the LICENSE file in the project root for more information. | ||
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone | ||
|
||
namespace BootstrapBlazor.Components; | ||
|
||
/// <summary> | ||
/// CacheManagerOptions 配置类 | ||
/// </summary> | ||
public class CacheManagerOptions | ||
{ | ||
/// <summary> | ||
/// 获得/设置 是否开启 CacheManager 功能 默认 true 开启 | ||
/// </summary> | ||
public bool Enable { get; set; } = true; | ||
|
||
/// <summary> | ||
/// 获得/设置 滑动缓存过期时间 默认 5 分钟 | ||
/// </summary> | ||
public TimeSpan SlidingExpiration { get; set; } = TimeSpan.FromMinutes(5); | ||
|
||
/// <summary> | ||
/// 获得/设置 绝对缓存过期时间 默认 10 秒钟 | ||
/// </summary> | ||
public TimeSpan AbsoluteExpiration { get; set; } = TimeSpan.FromSeconds(10); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters