mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
- added EventHandler in order to partecipate in cachekey generation
This commit is contained in:
parent
59a9f0bf03
commit
58e59e2fca
@ -41,6 +41,7 @@ namespace Orchard.OutputCache.Filters {
|
|||||||
private readonly ICacheService _cacheService;
|
private readonly ICacheService _cacheService;
|
||||||
private readonly ISignals _signals;
|
private readonly ISignals _signals;
|
||||||
private readonly ShellSettings _shellSettings;
|
private readonly ShellSettings _shellSettings;
|
||||||
|
private readonly ICachingEventHandler _chachingEvents;
|
||||||
private bool _isDisposed = false;
|
private bool _isDisposed = false;
|
||||||
|
|
||||||
public ILogger Logger { get; set; }
|
public ILogger Logger { get; set; }
|
||||||
@ -55,7 +56,8 @@ namespace Orchard.OutputCache.Filters {
|
|||||||
IClock clock,
|
IClock clock,
|
||||||
ICacheService cacheService,
|
ICacheService cacheService,
|
||||||
ISignals signals,
|
ISignals signals,
|
||||||
ShellSettings shellSettings) {
|
ShellSettings shellSettings,
|
||||||
|
ICachingEventHandler chachingEvents) {
|
||||||
|
|
||||||
_cacheManager = cacheManager;
|
_cacheManager = cacheManager;
|
||||||
_cacheStorageProvider = cacheStorageProvider;
|
_cacheStorageProvider = cacheStorageProvider;
|
||||||
@ -67,6 +69,7 @@ namespace Orchard.OutputCache.Filters {
|
|||||||
_cacheService = cacheService;
|
_cacheService = cacheService;
|
||||||
_signals = signals;
|
_signals = signals;
|
||||||
_shellSettings = shellSettings;
|
_shellSettings = shellSettings;
|
||||||
|
_chachingEvents = chachingEvents;
|
||||||
|
|
||||||
Logger = NullLogger.Instance;
|
Logger = NullLogger.Instance;
|
||||||
}
|
}
|
||||||
@ -610,6 +613,14 @@ namespace Orchard.OutputCache.Filters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//make CacheKey morphable by external modules
|
||||||
|
try {
|
||||||
|
keyBuilder = _chachingEvents.ParticipateInCacheKey(keyBuilder);
|
||||||
|
} catch (UnauthorizedAccessException ex) {
|
||||||
|
throw new UnauthorizedAccessException();
|
||||||
|
} catch { }
|
||||||
|
|
||||||
|
|
||||||
return keyBuilder.ToString();
|
return keyBuilder.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
using Orchard.Events;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Web;
|
||||||
|
|
||||||
|
namespace Orchard.OutputCache {
|
||||||
|
public interface ICachingEventHandler : IEventHandler {
|
||||||
|
StringBuilder ParticipateInCacheKey(StringBuilder key);
|
||||||
|
}
|
||||||
|
}
|
@ -103,6 +103,7 @@
|
|||||||
<Content Include="Web.config" />
|
<Content Include="Web.config" />
|
||||||
<Content Include="Scripts\Web.config" />
|
<Content Include="Scripts\Web.config" />
|
||||||
<Content Include="Styles\Web.config" />
|
<Content Include="Styles\Web.config" />
|
||||||
|
<Compile Include="ICachingEventHandler.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Content Include="Module.txt" />
|
<Content Include="Module.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
Reference in New Issue
Block a user