mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Refactored output cache provider to use atomic, Lua script-based key deletion.
This commit is contained in:
@@ -8,6 +8,7 @@ using Orchard.Logging;
|
||||
using Orchard.Redis.Configuration;
|
||||
using Orchard.OutputCache.Models;
|
||||
using Orchard.OutputCache.Services;
|
||||
using Orchard.Redis.Extensions;
|
||||
using StackExchange.Redis;
|
||||
|
||||
namespace Orchard.Redis.OutputCache {
|
||||
@@ -51,9 +52,7 @@ namespace Orchard.Redis.OutputCache {
|
||||
}
|
||||
|
||||
public void RemoveAll() {
|
||||
foreach (var key in GetAllKeys()) {
|
||||
Remove(key);
|
||||
}
|
||||
Database.KeyDeleteWithPrefix(GetLocalizedKey("*"));
|
||||
}
|
||||
|
||||
public CacheItem GetCacheItem(string key) {
|
||||
@@ -85,7 +84,7 @@ namespace Orchard.Redis.OutputCache {
|
||||
/// <param name="key">The key to localized.</param>
|
||||
/// <returns>A localized key based on the tenant name.</returns>
|
||||
private string GetLocalizedKey(string key) {
|
||||
return _shellSettings.Name + ":" + key;
|
||||
return _shellSettings.Name + ":OutputCache:" + key;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user