mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Removed support for Shared Cache from Azure caching providers.
Fixed bug in Azure output cache provider with tenant names containing non-alphanumeric characters. Removed all Azure-related assembly references from Orchard.Web.csproj.
This commit is contained in:
parent
690e7f60e1
commit
c8e277ba11
@ -1,27 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ServiceConfiguration serviceName="OrchardCloudService" osFamily="3" osVersion="*" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" schemaVersion="2013-03.2.0">
|
||||
<Role name="Orchard.Azure.Web">
|
||||
<Instances count="1" />
|
||||
<ConfigurationSettings>
|
||||
<Setting name="Orchard.Azure.Media.StorageConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="Orchard.Azure.Settings.StorageConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="Orchard.Azure.OutputCache.HostIdentifier" value="Orchard.Azure.Web" />
|
||||
<Setting name="Orchard.Azure.OutputCache.CacheName" value="OutputCache" />
|
||||
<Setting name="Orchard.Azure.OutputCache.Hostname" value="" />
|
||||
<Setting name="Orchard.Azure.OutputCache.Port" value="" />
|
||||
<Setting name="Orchard.Azure.OutputCache.AuthorizationToken" value="" />
|
||||
<Setting name="Orchard.Azure.OutputCache.IsSharedCaching" value="false" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.HostIdentifier" value="Orchard.Azure.Web" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.CacheName" value="DatabaseCache" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.Hostname" value="" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.Port" value="" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.AuthorizationToken" value="" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.IsSharedCaching" value="false" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0},{"name":"SessionStateCache","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":60,"isExpirable":true,"type":2},"serverNotification":{"isEnabled":false}},"secondaries":0},{"name":"OutputCache","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":5,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0},{"name":"DatabaseCache","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":5,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="1" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="UseDevelopmentStorage=true" />
|
||||
</ConfigurationSettings>
|
||||
</Role>
|
||||
<Role name="Orchard.Azure.Web">
|
||||
<Instances count="1" />
|
||||
<ConfigurationSettings>
|
||||
<Setting name="Orchard.Azure.Media.StorageConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="Orchard.Azure.Settings.StorageConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="Orchard.Azure.OutputCache.HostIdentifier" value="Orchard.Azure.Web" />
|
||||
<Setting name="Orchard.Azure.OutputCache.CacheName" value="OutputCache" />
|
||||
<Setting name="Orchard.Azure.OutputCache.AuthorizationToken" value="" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.HostIdentifier" value="Orchard.Azure.Web" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.CacheName" value="DatabaseCache" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.AuthorizationToken" value="" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0},{"name":"SessionStateCache","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":60,"isExpirable":true,"type":2},"serverNotification":{"isEnabled":false}},"secondaries":0},{"name":"OutputCache","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":5,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0},{"name":"DatabaseCache","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":5,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel" value="1" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="30" />
|
||||
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="UseDevelopmentStorage=true" />
|
||||
</ConfigurationSettings>
|
||||
</Role>
|
||||
</ServiceConfiguration>
|
@ -1,49 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ServiceDefinition name="OrchardCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
|
||||
<WebRole name="Orchard.Azure.Web">
|
||||
<Sites>
|
||||
<Site name="Web">
|
||||
<Bindings>
|
||||
<Binding name="HttpIn" endpointName="HttpIn" />
|
||||
</Bindings>
|
||||
</Site>
|
||||
</Sites>
|
||||
<Imports>
|
||||
<Import moduleName="Diagnostics" />
|
||||
<Import moduleName="Caching" />
|
||||
</Imports>
|
||||
<ConfigurationSettings>
|
||||
<Setting name="Orchard.Azure.Settings.StorageConnectionString" />
|
||||
<Setting name="Orchard.Azure.Media.StorageConnectionString" />
|
||||
<Setting name="Orchard.Azure.OutputCache.HostIdentifier" />
|
||||
<Setting name="Orchard.Azure.OutputCache.CacheName" />
|
||||
<Setting name="Orchard.Azure.OutputCache.Hostname" />
|
||||
<Setting name="Orchard.Azure.OutputCache.Port" />
|
||||
<Setting name="Orchard.Azure.OutputCache.AuthorizationToken" />
|
||||
<Setting name="Orchard.Azure.OutputCache.IsSharedCaching" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.HostIdentifier" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.CacheName" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.Hostname" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.Port" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.AuthorizationToken" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.IsSharedCaching" />
|
||||
</ConfigurationSettings>
|
||||
<Endpoints>
|
||||
<InputEndpoint name="HttpIn" protocol="http" port="80" />
|
||||
</Endpoints>
|
||||
<Startup>
|
||||
<Task commandLine="Startup\SetIdleTimeout.cmd" executionContext="elevated" taskType="simple">
|
||||
<Environment>
|
||||
<!-- Create the environment variable that informs the startup task whether it is running
|
||||
<WebRole name="Orchard.Azure.Web">
|
||||
<Sites>
|
||||
<Site name="Web">
|
||||
<Bindings>
|
||||
<Binding name="HttpIn" endpointName="HttpIn" />
|
||||
</Bindings>
|
||||
</Site>
|
||||
</Sites>
|
||||
<Imports>
|
||||
<Import moduleName="Diagnostics" />
|
||||
<Import moduleName="Caching" />
|
||||
</Imports>
|
||||
<ConfigurationSettings>
|
||||
<Setting name="Orchard.Azure.Settings.StorageConnectionString" />
|
||||
<Setting name="Orchard.Azure.Media.StorageConnectionString" />
|
||||
<Setting name="Orchard.Azure.OutputCache.HostIdentifier" />
|
||||
<Setting name="Orchard.Azure.OutputCache.CacheName" />
|
||||
<Setting name="Orchard.Azure.OutputCache.AuthorizationToken" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.HostIdentifier" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.CacheName" />
|
||||
<Setting name="Orchard.Azure.DatabaseCache.AuthorizationToken" />
|
||||
</ConfigurationSettings>
|
||||
<Endpoints>
|
||||
<InputEndpoint name="HttpIn" protocol="http" port="80" />
|
||||
</Endpoints>
|
||||
<Startup>
|
||||
<Task commandLine="Startup\SetIdleTimeout.cmd" executionContext="elevated" taskType="simple">
|
||||
<Environment>
|
||||
<!-- Create the environment variable that informs the startup task whether it is running
|
||||
in the compute emulator or in the cloud. -->
|
||||
<Variable name="ComputeEmulatorRunning">
|
||||
<RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
|
||||
</Variable>
|
||||
</Environment>
|
||||
</Task>
|
||||
</Startup>
|
||||
<LocalResources>
|
||||
<LocalStorage name="DiagnosticStore" sizeInMB="20000" cleanOnRoleRecycle="false" />
|
||||
</LocalResources>
|
||||
</WebRole>
|
||||
<Variable name="ComputeEmulatorRunning">
|
||||
<RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
|
||||
</Variable>
|
||||
</Environment>
|
||||
</Task>
|
||||
</Startup>
|
||||
<LocalResources>
|
||||
<LocalStorage name="DiagnosticStore" sizeInMB="20000" cleanOnRoleRecycle="false" />
|
||||
</LocalResources>
|
||||
</WebRole>
|
||||
</ServiceDefinition>
|
@ -16,9 +16,6 @@
|
||||
|
||||
public const string CacheHostIdentifierSettingName = "HostIdentifier";
|
||||
public const string CacheCacheNameSettingName = "CacheName";
|
||||
public const string CacheHostnameSettingName = "Hostname";
|
||||
public const string CachePortSettingName = "Port";
|
||||
public const string CacheAuthorizationTokenSettingName = "AuthorizationToken";
|
||||
public const string CacheIsSharedCachingSettingName = "IsSharedCaching";
|
||||
}
|
||||
}
|
@ -49,6 +49,14 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\log4net\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.AzureClientHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.AzureCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureCommon.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
|
||||
@ -57,14 +65,46 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.Edm, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.Data.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.OData, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.Data.OData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.DistributedCache, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.Web.DistributedCache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Diagnostics.StorageUtility, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsFabric.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsFabric.Data.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\windowsazure\Microsoft.WindowsFabric.Data.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\nhibernate\NHibernate.dll</HintPath>
|
||||
|
@ -7,15 +7,10 @@ namespace Orchard.Azure.Services.Caching {
|
||||
public class CacheClientConfiguration {
|
||||
|
||||
public static CacheClientConfiguration FromPlatformConfiguration(string tenant, string settingNamePrefix) {
|
||||
var portString = PlatformConfiguration.GetSetting(Constants.CachePortSettingName, tenant, settingNamePrefix);
|
||||
var isSharedCachingString = PlatformConfiguration.GetSetting(Constants.CacheIsSharedCachingSettingName, tenant, settingNamePrefix);
|
||||
return new CacheClientConfiguration {
|
||||
HostIdentifier = PlatformConfiguration.GetSetting(Constants.CacheHostIdentifierSettingName, tenant, settingNamePrefix),
|
||||
CacheName = PlatformConfiguration.GetSetting(Constants.CacheCacheNameSettingName, tenant, settingNamePrefix),
|
||||
Hostname = PlatformConfiguration.GetSetting(Constants.CacheHostnameSettingName, tenant, settingNamePrefix),
|
||||
Port = String.IsNullOrWhiteSpace(portString) ? 0 : Int32.Parse(portString),
|
||||
AuthorizationToken = PlatformConfiguration.GetSetting(Constants.CacheAuthorizationTokenSettingName, tenant, settingNamePrefix),
|
||||
IsSharedCaching = !String.IsNullOrWhiteSpace(isSharedCachingString) && Boolean.Parse(isSharedCachingString)
|
||||
};
|
||||
}
|
||||
|
||||
@ -29,40 +24,19 @@ namespace Orchard.Azure.Services.Caching {
|
||||
protected set;
|
||||
}
|
||||
|
||||
public string Hostname {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public int Port {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public string AuthorizationToken {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public bool IsSharedCaching {
|
||||
get;
|
||||
protected set;
|
||||
}
|
||||
|
||||
public bool CompressionIsEnabled {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool AutodiscoverIsEnabled {
|
||||
get {
|
||||
return String.IsNullOrWhiteSpace(Hostname) || Port == 0 || String.IsNullOrWhiteSpace(AuthorizationToken);
|
||||
}
|
||||
}
|
||||
|
||||
public void Validate() {
|
||||
if (AutodiscoverIsEnabled && String.IsNullOrWhiteSpace(HostIdentifier)) {
|
||||
throw new Exception("AutoDiscover mode is detected but HostIdentifier is missing or empty.");
|
||||
if (String.IsNullOrWhiteSpace(HostIdentifier)) {
|
||||
throw new Exception("The HostIdentifier value is missing or empty.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,27 +47,22 @@ namespace Orchard.Azure.Services.Caching {
|
||||
IsCompressionEnabled = CompressionIsEnabled
|
||||
};
|
||||
|
||||
if (AutodiscoverIsEnabled) {
|
||||
dataCacheFactoryConfiguration.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, HostIdentifier);
|
||||
}
|
||||
else {
|
||||
dataCacheFactoryConfiguration.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(false);
|
||||
dataCacheFactoryConfiguration.Servers = new[] { new DataCacheServerEndpoint(Hostname, Port) };
|
||||
dataCacheFactoryConfiguration.SecurityProperties = new DataCacheSecurity(AuthorizationToken);
|
||||
}
|
||||
dataCacheFactoryConfiguration.AutoDiscoverProperty = new DataCacheAutoDiscoverProperty(true, HostIdentifier);
|
||||
if (!String.IsNullOrEmpty(AuthorizationToken))
|
||||
dataCacheFactoryConfiguration.SecurityProperties = new DataCacheSecurity(AuthorizationToken, sslEnabled: false);
|
||||
|
||||
var dataCacheFactory = new DataCacheFactory(dataCacheFactoryConfiguration);
|
||||
|
||||
if (IsSharedCaching || String.IsNullOrEmpty(CacheName)) {
|
||||
return dataCacheFactory.GetDefaultCache();
|
||||
if (!String.IsNullOrEmpty(CacheName)) {
|
||||
return dataCacheFactory.GetCache(CacheName);
|
||||
}
|
||||
|
||||
return dataCacheFactory.GetCache(CacheName);
|
||||
return dataCacheFactory.GetDefaultCache();
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
var key = HostIdentifier + "_" + CacheName + "_" + Hostname + "_" + Port + "_" + AuthorizationToken + "_" + IsSharedCaching + "_" + CompressionIsEnabled;
|
||||
return key;
|
||||
}
|
||||
//public override string ToString() {
|
||||
// var key = HostIdentifier + "_" + CacheName + "_" + Hostname + "_" + Port + "_" + AuthorizationToken + "_" + IsSharedCaching + "_" + CompressionIsEnabled;
|
||||
// return key;
|
||||
//}
|
||||
}
|
||||
}
|
@ -8,22 +8,19 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
|
||||
public class AzureCacheClient : ICache {
|
||||
|
||||
public AzureCacheClient(DataCache cache, bool isSharedCaching, string region, TimeSpan? expirationTime) {
|
||||
public AzureCacheClient(DataCache cache, string region, TimeSpan? expirationTime) {
|
||||
_logger = LoggerProvider.LoggerFor(typeof(AzureCacheClient));
|
||||
_cache = cache;
|
||||
_isSharedCaching = isSharedCaching;
|
||||
_region = region ?? DefaultRegion;
|
||||
// Azure Cache supports only alphanumeric strings for regions and
|
||||
// Orchard can get a lot more creative than that. Remove all non
|
||||
// Azure Cache supports only alphanumeric strings for regions, but
|
||||
// NHibernate can get a lot more creative than that. Remove all non
|
||||
// alphanumering characters from the region, and append the hash code
|
||||
// of the original string to mitigate the risk of two distinct original
|
||||
// region strings yielding the same transformed region string.
|
||||
_regionAlphaNumeric = new String(Array.FindAll(_region.ToCharArray(), Char.IsLetterOrDigit)) + _region.GetHashCode().ToString(CultureInfo.InvariantCulture);
|
||||
_expirationTime = expirationTime;
|
||||
|
||||
if (!isSharedCaching) {
|
||||
_cache.CreateRegion(_regionAlphaNumeric);
|
||||
}
|
||||
_cache.CreateRegion(_regionAlphaNumeric);
|
||||
|
||||
//_lockHandleDictionary = new ConcurrentDictionary<object, DataCacheLockHandle>();
|
||||
//_lockTimeout = TimeSpan.FromSeconds(30);
|
||||
@ -36,22 +33,17 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
private const string DefaultRegion = "NHibernate";
|
||||
private readonly IInternalLogger _logger;
|
||||
private readonly DataCache _cache;
|
||||
private readonly bool _isSharedCaching;
|
||||
private readonly string _region;
|
||||
private readonly string _regionAlphaNumeric;
|
||||
private readonly TimeSpan? _expirationTime;
|
||||
|
||||
public object Get(object key) {
|
||||
if (key == null)
|
||||
if (key == null) {
|
||||
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
|
||||
}
|
||||
|
||||
if (_logger.IsDebugEnabled) {
|
||||
if (_logger.IsDebugEnabled)
|
||||
_logger.DebugFormat("Get() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
if (_isSharedCaching) {
|
||||
return _cache.Get(GetSharedCachingKey(key));
|
||||
}
|
||||
|
||||
return _cache.Get(key.ToString(), _regionAlphaNumeric);
|
||||
}
|
||||
@ -60,7 +52,6 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
if (key == null) {
|
||||
throw new ArgumentNullException("key", "The parameter 'key' must not be null.");
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
throw new ArgumentNullException("value", "The parameter 'value' must not be null.");
|
||||
}
|
||||
@ -69,10 +60,7 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
_logger.DebugFormat("Put() invoked with key='{0}' and value='{1}' in region '{2}'.", key, value, _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
if (_isSharedCaching) {
|
||||
_cache.Put(GetSharedCachingKey(key), value);
|
||||
}
|
||||
else if (_expirationTime.HasValue) {
|
||||
if (_expirationTime.HasValue) {
|
||||
_cache.Put(key.ToString(), value, _expirationTime.Value, _regionAlphaNumeric);
|
||||
}
|
||||
else {
|
||||
@ -89,10 +77,6 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
_logger.DebugFormat("Remove() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
if (_isSharedCaching) {
|
||||
_cache.Remove(key.ToString());
|
||||
}
|
||||
|
||||
_cache.Remove(key.ToString(), _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
@ -101,10 +85,6 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
_logger.DebugFormat("Clear() invoked in region '{0}'.", _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
if (_isSharedCaching) {
|
||||
return; // Can't remove an individual region with Shared Caching.
|
||||
}
|
||||
|
||||
_cache.ClearRegion(_regionAlphaNumeric);
|
||||
}
|
||||
|
||||
@ -193,9 +173,5 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
return _region;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSharedCachingKey(object key) {
|
||||
return String.Format("{0}_{1}", _region, key);
|
||||
}
|
||||
}
|
||||
}
|
@ -8,7 +8,6 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
public class AzureCacheProvider : ICacheProvider {
|
||||
|
||||
private DataCache _dataCache;
|
||||
private bool _isSharedCaching;
|
||||
|
||||
public ICache BuildCache(string regionName, IDictionary<string, string> properties) {
|
||||
|
||||
@ -22,7 +21,7 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
expiration = TimeSpan.FromSeconds(Int32.Parse(expirationString));
|
||||
}
|
||||
|
||||
return new AzureCacheClient(_dataCache, _isSharedCaching, regionName, expiration);
|
||||
return new AzureCacheClient(_dataCache, regionName, expiration);
|
||||
}
|
||||
|
||||
public long NextTimestamp() {
|
||||
@ -49,7 +48,6 @@ namespace Orchard.Azure.Services.Caching.Database {
|
||||
}
|
||||
|
||||
_dataCache = configuration.CreateCache();
|
||||
_isSharedCaching = configuration.IsSharedCaching;
|
||||
}
|
||||
|
||||
public void Stop() {
|
||||
|
@ -7,6 +7,7 @@ using Orchard.Environment.Extensions;
|
||||
using Orchard.Logging;
|
||||
using Orchard.OutputCache.Models;
|
||||
using Orchard.OutputCache.Services;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Orchard.Azure.Services.Caching.Output {
|
||||
|
||||
@ -25,68 +26,44 @@ namespace Orchard.Azure.Services.Caching.Output {
|
||||
}
|
||||
|
||||
_cache = _cacheConfig.CreateCache();
|
||||
_region = shellSettings.Name;
|
||||
|
||||
if (!_cacheConfig.IsSharedCaching) {
|
||||
// If not using Windows Azure Shared Caching we can enable additional features by
|
||||
// storing all cache items in a region. This enables enumerating and counting all
|
||||
// items currently in the cache.
|
||||
_region = shellSettings.Name;
|
||||
_cache.CreateRegion(_region);
|
||||
}
|
||||
// Azure Cache supports only alphanumeric strings for regions, but Orchard supports some
|
||||
// non-alphanumeric characters in tenant names. Remove all non-alphanumering characters
|
||||
// from the region, and append the hash code of the original string to mitigate the risk
|
||||
// of two distinct original region strings yielding the same transformed region string.
|
||||
_regionAlphaNumeric = new String(Array.FindAll(_region.ToCharArray(), Char.IsLetterOrDigit)) + _region.GetHashCode().ToString(CultureInfo.InvariantCulture);
|
||||
_cache.CreateRegion(_regionAlphaNumeric);
|
||||
}
|
||||
|
||||
private readonly CacheClientConfiguration _cacheConfig;
|
||||
private readonly DataCache _cache;
|
||||
private readonly string _region;
|
||||
private readonly string _regionAlphaNumeric;
|
||||
|
||||
public void Set(string key, CacheItem cacheItem) {
|
||||
Logger.Debug("Set() invoked with key='{0}' in region '{1}'.", key, _region);
|
||||
if (_cacheConfig.IsSharedCaching) {
|
||||
_cache.Put(key, cacheItem);
|
||||
}
|
||||
else {
|
||||
_cache.Put(key, cacheItem, TimeSpan.FromSeconds(cacheItem.ValidFor), _region);
|
||||
}
|
||||
Logger.Debug("Set() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
|
||||
_cache.Put(key, cacheItem, TimeSpan.FromSeconds(cacheItem.ValidFor), _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
public void Remove(string key) {
|
||||
Logger.Debug("Remove() invoked with key='{0}' in region '{1}'.", key, _region);
|
||||
if (_cacheConfig.IsSharedCaching) {
|
||||
_cache.Remove(key);
|
||||
}
|
||||
else {
|
||||
_cache.Remove(key, _region);
|
||||
}
|
||||
Logger.Debug("Remove() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
|
||||
_cache.Remove(key, _regionAlphaNumeric);
|
||||
}
|
||||
|
||||
public void RemoveAll() {
|
||||
Logger.Debug("RemoveAll() invoked in region '{0}'.", _region);
|
||||
if (_cacheConfig.IsSharedCaching) {
|
||||
_cache.Clear();
|
||||
}
|
||||
else {
|
||||
_cache.ClearRegion(_region);
|
||||
}
|
||||
Logger.Debug("RemoveAll() invoked in region '{0}'.", _regionAlphaNumeric);
|
||||
_cache.ClearRegion(_regionAlphaNumeric);
|
||||
}
|
||||
|
||||
public CacheItem GetCacheItem(string key) {
|
||||
Logger.Debug("GetCacheItem() invoked with key='{0}' in region '{1}'.", key, _region);
|
||||
if (_cacheConfig.IsSharedCaching) {
|
||||
return _cache.Get(key) as CacheItem;
|
||||
}
|
||||
else {
|
||||
return _cache.Get(key, _region) as CacheItem;
|
||||
}
|
||||
Logger.Debug("GetCacheItem() invoked with key='{0}' in region '{1}'.", key, _regionAlphaNumeric);
|
||||
return _cache.Get(key, _regionAlphaNumeric) as CacheItem;
|
||||
}
|
||||
|
||||
public IEnumerable<CacheItem> GetCacheItems(int skip, int count) {
|
||||
Logger.Debug("GetCacheItems() invoked in region '{0}'.", _region);
|
||||
if (_cacheConfig.IsSharedCaching) {
|
||||
Logger.Debug("Enumeration not supported with Shared Caching; returning empty enumerable.");
|
||||
return Enumerable.Empty<CacheItem>(); // Enumeration not supported with Shared Caching.
|
||||
}
|
||||
|
||||
return _cache.GetObjectsInRegion(_region).AsParallel()
|
||||
Logger.Debug("GetCacheItems() invoked in region '{0}'.", _regionAlphaNumeric);
|
||||
return _cache.GetObjectsInRegion(_regionAlphaNumeric).AsParallel()
|
||||
.Select(x => x.Value)
|
||||
.OfType<CacheItem>()
|
||||
.Skip(skip)
|
||||
@ -95,13 +72,8 @@ namespace Orchard.Azure.Services.Caching.Output {
|
||||
}
|
||||
|
||||
public int GetCacheItemsCount() {
|
||||
Logger.Debug("GetCacheItemsCount() invoked in region '{0}'.", _region);
|
||||
if (_cacheConfig.IsSharedCaching) {
|
||||
Logger.Debug("Enumeration not supported with Shared Caching; returning zero.");
|
||||
return 0; // Enumeration not supported with Shared Caching.
|
||||
}
|
||||
|
||||
return _cache.GetObjectsInRegion(_region).AsParallel()
|
||||
Logger.Debug("GetCacheItemsCount() invoked in region '{0}'.", _regionAlphaNumeric);
|
||||
return _cache.GetObjectsInRegion(_regionAlphaNumeric).AsParallel()
|
||||
.Select(x => x.Value)
|
||||
.OfType<CacheItem>()
|
||||
.Count();
|
||||
|
@ -49,62 +49,10 @@
|
||||
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.AzureClientHelper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.AzureCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.AzureCommon.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.ApplicationServer.Caching.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.Edm, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.Data.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Data.OData, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.Data.OData.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.DistributedCache, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.Web.DistributedCache.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\lib\aspnetmvc\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.Configuration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Diagnostics, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.Diagnostics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.ServiceRuntime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsAzure.Storage, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsAzure.Storage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsFabric.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsFabric.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.WindowsFabric.Data.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\lib\windowsazure\Microsoft.WindowsFabric.Data.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\..\lib\newtonsoft.json\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
@ -288,17 +236,17 @@
|
||||
<Target Name="BeforeBuild">
|
||||
</Target> -->
|
||||
<ItemGroup>
|
||||
<RootBinFiles Include="bin\*">
|
||||
<InProject>false</InProject>
|
||||
</RootBinFiles>
|
||||
<RootBinFiles Include="bin\*">
|
||||
<InProject>false</InProject>
|
||||
</RootBinFiles>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<!-- This way for some reason doesn't work even though it resolves to the exact same string:
|
||||
<!-- This way for some reason doesn't work even though it resolves to the exact same string:
|
||||
<ExcludeSubBinFiles>@(RootBinFiles->'Modules\**\bin\%(Filename)%(Extension)')</ExcludeSubBinFiles> -->
|
||||
<!-- This way is a temporary hack that does the same thing but is obviously less maintainable: -->
|
||||
<ExcludeSubBinFiles>Modules\**\bin\Autofac.Configuration.dll;Modules\**\bin\Autofac.Configuration.pdb;Modules\**\bin\Autofac.Configuration.xml;Modules\**\bin\Autofac.dll;Modules\**\bin\Autofac.pdb;Modules\**\bin\Autofac.xml;Modules\**\bin\Castle.Core.dll;Modules\**\bin\Castle.Core.xml;Modules\**\bin\Castle.DynamicProxy2.dll;Modules\**\bin\Castle.DynamicProxy2.xml;Modules\**\bin\FluentNHibernate.dll;Modules\**\bin\FluentNHibernate.xml;Modules\**\bin\Iesi.Collections.dll;Modules\**\bin\Iesi.Collections.xml;Modules\**\bin\log4net.dll;Modules\**\bin\log4net.xml;Modules\**\bin\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.AzureCommon.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.AzureCommon.xml;Modules\**\bin\Microsoft.ApplicationServer.Caching.Client.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.Client.xml;Modules\**\bin\Microsoft.ApplicationServer.Caching.Core.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.Core.xml;Modules\**\bin\Microsoft.Data.Edm.dll;Modules\**\bin\Microsoft.Data.OData.dll;Modules\**\bin\Microsoft.Web.DistributedCache.dll;Modules\**\bin\Microsoft.Web.Infrastructure.dll;Modules\**\bin\Microsoft.WindowsAzure.Configuration.dll;Modules\**\bin\Microsoft.WindowsAzure.Diagnostics.dll;Modules\**\bin\Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll;Modules\**\bin\Microsoft.WindowsAzure.Diagnostics.xml;Modules\**\bin\Microsoft.WindowsAzure.Storage.dll;Modules\**\bin\Microsoft.WindowsAzure.Storage.xml;Modules\**\bin\Microsoft.WindowsFabric.Common.dll;Modules\**\bin\Microsoft.WindowsFabric.Data.Common.dll;Modules\**\bin\MySql.Data.dll;Modules\**\bin\Newtonsoft.Json.dll;Modules\**\bin\Newtonsoft.Json.xml;Modules\**\bin\NHibernate.dll;Modules\**\bin\NHibernate.Linq.dll;Modules\**\bin\NHibernate.SqlAzure.dll;Modules\**\bin\NHibernate.SqlAzure.pdb;Modules\**\bin\NHibernate.xml;Modules\**\bin\NuGet.Core.dll;Modules\**\bin\Orchard.Core.dll;Modules\**\bin\Orchard.Core.pdb;Modules\**\bin\Orchard.exe;Modules\**\bin\Orchard.Framework.dll;Modules\**\bin\Orchard.Framework.pdb;Modules\**\bin\Orchard.pdb;Modules\**\bin\Orchard.WarmupStarter.dll;Modules\**\bin\Orchard.WarmupStarter.pdb;Modules\**\bin\Orchard.Web.dll;Modules\**\bin\Orchard.Web.pdb;Modules\**\bin\System.Data.SqlServerCe.dll;Modules\**\bin\System.Net.Http.dll;Modules\**\bin\System.Net.Http.Formatting.dll;Modules\**\bin\System.Net.Http.Formatting.xml;Modules\**\bin\System.Net.Http.xml;Modules\**\bin\System.Spatial.dll;Modules\**\bin\System.Web.Helpers.dll;Modules\**\bin\System.Web.Helpers.xml;Modules\**\bin\System.Web.Http.dll;Modules\**\bin\System.Web.Http.WebHost.dll;Modules\**\bin\System.Web.Http.WebHost.xml;Modules\**\bin\System.Web.Http.xml;Modules\**\bin\System.Web.Mvc.dll;Modules\**\bin\System.Web.Mvc.xml;Modules\**\bin\System.Web.Razor.dll;Modules\**\bin\System.Web.Razor.xml;Modules\**\bin\System.Web.WebPages.Deployment.dll;Modules\**\bin\System.Web.WebPages.Deployment.xml;Modules\**\bin\System.Web.WebPages.dll;Modules\**\bin\System.Web.WebPages.Razor.dll;Modules\**\bin\System.Web.WebPages.Razor.xml;Modules\**\bin\System.Web.WebPages.xml</ExcludeSubBinFiles>
|
||||
<!-- This way is a temporary hack that does the same thing but is obviously less maintainable: -->
|
||||
<ExcludeSubBinFiles>Modules\**\bin\Autofac.Configuration.dll;Modules\**\bin\Autofac.Configuration.pdb;Modules\**\bin\Autofac.Configuration.xml;Modules\**\bin\Autofac.dll;Modules\**\bin\Autofac.pdb;Modules\**\bin\Autofac.xml;Modules\**\bin\Castle.Core.dll;Modules\**\bin\Castle.Core.xml;Modules\**\bin\Castle.DynamicProxy2.dll;Modules\**\bin\Castle.DynamicProxy2.xml;Modules\**\bin\FluentNHibernate.dll;Modules\**\bin\FluentNHibernate.xml;Modules\**\bin\Iesi.Collections.dll;Modules\**\bin\Iesi.Collections.xml;Modules\**\bin\log4net.dll;Modules\**\bin\log4net.xml;Modules\**\bin\Microsoft.ApplicationServer.Caching.AzureClientHelper.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.AzureCommon.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.AzureCommon.xml;Modules\**\bin\Microsoft.ApplicationServer.Caching.Client.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.Client.xml;Modules\**\bin\Microsoft.ApplicationServer.Caching.Core.dll;Modules\**\bin\Microsoft.ApplicationServer.Caching.Core.xml;Modules\**\bin\Microsoft.Data.Edm.dll;Modules\**\bin\Microsoft.Data.OData.dll;Modules\**\bin\Microsoft.Web.DistributedCache.dll;Modules\**\bin\Microsoft.Web.Infrastructure.dll;Modules\**\bin\Microsoft.WindowsAzure.Configuration.dll;Modules\**\bin\Microsoft.WindowsAzure.Diagnostics.dll;Modules\**\bin\Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll;Modules\**\bin\Microsoft.WindowsAzure.Diagnostics.xml;Modules\**\bin\Microsoft.WindowsAzure.Storage.dll;Modules\**\bin\Microsoft.WindowsAzure.Storage.xml;Modules\**\bin\Microsoft.WindowsFabric.Common.dll;Modules\**\bin\Microsoft.WindowsFabric.Data.Common.dll;Modules\**\bin\MySql.Data.dll;Modules\**\bin\Newtonsoft.Json.dll;Modules\**\bin\Newtonsoft.Json.xml;Modules\**\bin\NHibernate.dll;Modules\**\bin\NHibernate.Linq.dll;Modules\**\bin\NHibernate.SqlAzure.dll;Modules\**\bin\NHibernate.SqlAzure.pdb;Modules\**\bin\NHibernate.xml;Modules\**\bin\NuGet.Core.dll;Modules\**\bin\Orchard.Core.dll;Modules\**\bin\Orchard.Core.pdb;Modules\**\bin\Orchard.exe;Modules\**\bin\Orchard.Framework.dll;Modules\**\bin\Orchard.Framework.pdb;Modules\**\bin\Orchard.pdb;Modules\**\bin\Orchard.WarmupStarter.dll;Modules\**\bin\Orchard.WarmupStarter.pdb;Modules\**\bin\Orchard.Web.dll;Modules\**\bin\Orchard.Web.pdb;Modules\**\bin\System.Data.SqlServerCe.dll;Modules\**\bin\System.Net.Http.dll;Modules\**\bin\System.Net.Http.Formatting.dll;Modules\**\bin\System.Net.Http.Formatting.xml;Modules\**\bin\System.Net.Http.xml;Modules\**\bin\System.Spatial.dll;Modules\**\bin\System.Web.Helpers.dll;Modules\**\bin\System.Web.Helpers.xml;Modules\**\bin\System.Web.Http.dll;Modules\**\bin\System.Web.Http.WebHost.dll;Modules\**\bin\System.Web.Http.WebHost.xml;Modules\**\bin\System.Web.Http.xml;Modules\**\bin\System.Web.Mvc.dll;Modules\**\bin\System.Web.Mvc.xml;Modules\**\bin\System.Web.Razor.dll;Modules\**\bin\System.Web.Razor.xml;Modules\**\bin\System.Web.WebPages.Deployment.dll;Modules\**\bin\System.Web.WebPages.Deployment.xml;Modules\**\bin\System.Web.WebPages.dll;Modules\**\bin\System.Web.WebPages.Razor.dll;Modules\**\bin\System.Web.WebPages.Razor.xml;Modules\**\bin\System.Web.WebPages.xml</ExcludeSubBinFiles>
|
||||
<ExcludeFilesFromDeployment>$(ExcludeSubBinFiles);**\*.Debug.config;**\*.Release.config;**\obj\**;**\bin\*.xml;**\*.cs;**\*.csproj;Modules\**\Tests\**;**\.hgignore;**\.hgtags;**\.hg\**;**\*.csproj.user;App_Data\Dependencies\*;App_Data\RecipeQueue\*;App_Data\Logs\*;App_Data\**\mappings.bin;App_Data\**\cache.dat;App_Data\**\hrestart.txt</ExcludeFilesFromDeployment>
|
||||
</PropertyGroup>
|
||||
</PropertyGroup>
|
||||
<Target Name="CopySqlCeBinaries">
|
||||
<ItemGroup>
|
||||
<SqlCeBinariesx86 Include="$(ProjectDir)..\..\lib\sqlce\x86\**\*" />
|
||||
|
@ -8,7 +8,11 @@
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false"/>
|
||||
</sectionGroup>
|
||||
<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
|
||||
<!--
|
||||
Uncomment below to store session state in Windows Azure Cache Service.
|
||||
NOTE: You must add assembly references to all assemblies in lib/windowsazure before enabling.
|
||||
-->
|
||||
<!--<section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />-->
|
||||
</configSections>
|
||||
|
||||
<appSettings>
|
||||
@ -34,11 +38,16 @@
|
||||
|
||||
<!--
|
||||
Uncomment below to store session state in Windows Azure Cache Service.
|
||||
Set {CacheHostIdentifier} to be the endpoint of the cache cluster.
|
||||
Set the autoDiscover/@identifier attribute to be the endpoint of the cache cluster.
|
||||
Set the messageSecurity/@authorizationInfo to be either the primary or secondary key of your cache cluster.
|
||||
NOTE: You must add assembly references to all assemblies in lib/windowsazure before enabling.
|
||||
-->
|
||||
<!--<dataCacheClients>
|
||||
<dataCacheClient name="DefaultCacheClient" useLegacyProtocol="false" connectionPool="true" maxConnectionsToServer="20">
|
||||
<autoDiscover isEnabled="true" identifier="{CacheHostIdentifier}" />
|
||||
<autoDiscover isEnabled="true" identifier="[clustername].cache.windows.net" />
|
||||
<securityProperties mode="Message" sslEnabled="false">
|
||||
<messageSecurity authorizationInfo="[key]"/>
|
||||
</securityProperties>
|
||||
</dataCacheClient>
|
||||
</dataCacheClients>-->
|
||||
|
||||
@ -91,10 +100,14 @@
|
||||
<forms loginUrl="~/Users/Account/AccessDenied" timeout="2880"/>
|
||||
</authentication>
|
||||
|
||||
<!-- Uncomment below to store session state in Windows Azure Cache (replace {CacheName} with name of your configured cache). -->
|
||||
<!--
|
||||
Uncomment below to store session state in Windows Azure Cache Service.
|
||||
Set the add/@cacheName attribute to be the name of a configured named cache, or leave it blank to use the default cache.
|
||||
NOTE: You must add assembly references to all assemblies in lib/windowsazure before enabling.
|
||||
-->
|
||||
<!--<sessionState mode="Custom" timeout="60" customProvider="CacheSessionStateProvider">
|
||||
<providers>
|
||||
<add name="CacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="{CacheName}" dataCacheClientName="DefaultCacheClient" applicationName="Orchard" />
|
||||
<add name="CacheSessionStateProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="[cacheName]" dataCacheClientName="DefaultCacheClient" applicationName="Orchard" />
|
||||
</providers>
|
||||
</sessionState>-->
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user