Refactored output cache provider to use atomic, Lua script-based key deletion.

This commit is contained in:
Piotr Szmyd
2014-10-15 09:43:23 +02:00
parent b79f2e2db2
commit 3b6f978100

View File

@@ -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>