Enabled caching by default in Orchard.Azure.Web cloud service role.

Enabled session state cache provider by default in Orchard.Azure.Wew.
Moved all string constants into Constants class.
Got rid of unused implicit module feature of Orchard.Azure.
Added missing settings banner.
Split Orchard.StorageConnectionString role configuration setting up into two separate settings for Media and Settings respectively.
Renamed startup task.
Removed hard coded connection string and container name from AzureFileSystem, making it truly reusable.
This commit is contained in:
Daniel Stolt
2013-08-25 20:44:49 +02:00
committed by Sebastien Ros
parent 5872371189
commit ca34a462b6
16 changed files with 187 additions and 63 deletions

View File

@@ -52,7 +52,7 @@
<Folder Include="Profiles" />
</ItemGroup>
<ItemGroup>
<Content Include="Orchard.Azure.WebContent\Bin\Startup\ConfigureIIS.cmd">
<Content Include="Orchard.Azure.WebContent\Bin\Startup\SetIdleTimeout.cmd">
<SubType>Content</SubType>
</Content>
<Content Include="Orchard.Azure.WebContent\diagnostics.wadcfg">

View File

@@ -1,5 +0,0 @@
REM Check if this task is running on the compute emulator, if not then sets the Idle Timeout to zero
IF "%ComputeEmulatorRunning%" == "false" (
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.processModel.idleTimeout:00:00:00
)

View File

@@ -3,8 +3,13 @@
<Role name="Orchard.Azure.Web">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Orchard.StorageConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Orchard.Media.StorageConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Orchard.Settings.StorageConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="{&quot;caches&quot;:[{&quot;name&quot;:&quot;default&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0},{&quot;name&quot;:&quot;SessionStateCache&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0},{&quot;name&quot;:&quot;OutputCache&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;:0},{&quot;name&quot;:&quot;DatabaseCache&quot;,&quot;policy&quot;:{&quot;eviction&quot;:{&quot;type&quot;:0},&quot;expiration&quot;:{&quot;defaultTTL&quot;:10,&quot;isExpirable&quot;:true,&quot;type&quot;:1},&quot;serverNotification&quot;:{&quot;isEnabled&quot;:false}},&quot;secondaries&quot;: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>

View File

@@ -10,25 +10,28 @@
</Sites>
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="Caching" />
</Imports>
<ConfigurationSettings>
<Setting name="Orchard.StorageConnectionString" />
<Setting name="Orchard.Settings.StorageConnectionString" />
<Setting name="Orchard.Media.StorageConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InputEndpoint name="HttpIn" protocol="http" port="80" />
</Endpoints>
<Startup>
<Task commandLine="Startup\ConfigureIIS.cmd" executionContext="elevated" taskType="simple">
<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. "%ComputeEmulatorRunning%"=="true" when
running in the Compute Emulator, "%ComputeEmulatorRunning%"=="false" when running
in the cloud. -->
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>
</ServiceDefinition>

View File

@@ -36,11 +36,11 @@
To use the in-role flavor of Windows Azure Caching, set {CacheHostIdentifier} to be the cache cluster role name.
To use the Windows Azure Caching Service, set {CacheHostIdentifier} to be the endpoint of the cache cluster.
-->
<!--<dataCacheClients>
<dataCacheClients>
<dataCacheClient name="DefaultCacheClient" useLegacyProtocol="false" connectionPool="true" maxConnectionsToServer="20">
<autoDiscover isEnabled="true" identifier="{CacheHostIdentifier}" />
</dataCacheClient>
</dataCacheClients>-->
</dataCacheClients>
<system.diagnostics>
<trace>
@@ -102,11 +102,11 @@
</authentication>
<!-- Uncomment below to store session state in Windows Azure Cache (replace {CacheName} with name of your configured cache). -->
<!--<sessionState mode="Custom" timeout="60" customProvider="CacheSessionStateProvider">
<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" />
</providers>
</sessionState>-->
</sessionState>
<customErrors mode="RemoteOnly" />