session - Co-located cache not working in web role -


my sessions not being cached. using co-located caching on web role.

i have following in web.config:

<configsections>   <section name="cachediagnostics" type="microsoft.applicationserver.caching.azurecommon.diagnosticsconfigurationsection, microsoft.applicationserver.caching.azurecommon" allowlocation="true" allowdefinition="everywhere" /> </configsections> ... <datacacheclients>   <datacacheclient name="default">     <autodiscover isenabled="true" identifier="website" />   </datacacheclient> </datacacheclients> 

my cloud service definition (.csdef) follows:

<servicedefinition name="webcloud.test" ...>   <webrole name="website" vmsize="small">     <sites>       <site name="web">         <bindings>           <binding name="endpoint1" endpointname="endpoint1" />         </bindings>       </site>     </sites>     <endpoints>       <inputendpoint name="endpoint1" protocol="http" port="80" />     </endpoints>     <imports>       <import modulename="caching" />     </imports>     <startup priority="-2">       <task commandline="microsoft.windowsazure.caching\clientperfcountersinstaller.exe install" executioncontext="elevated" tasktype="simple" />     </startup>   </webrole> </servicedefinition> 

and following in configurationsettings of cscfg file:

<setting name="microsoft.windowsazure.plugins.caching.configstoreconnectionstring" value="defaultendpointsprotocol=http;accountname=accountname;accountkey=accountkey==" /> <setting name="microsoft.windowsazure.plugins.caching.clientdiagnosticlevel" value="1" /> <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}]}" /> <setting name="microsoft.windowsazure.plugins.caching.diagnosticlevel" value="1" /> <setting name="microsoft.windowsazure.plugins.caching.cachesizepercentage" value="20" /> 

can spot why not working? perhaps identifier set in datacacheclients?

i fixed issue. following needs included in web.config:

<sessionstate mode="custom" customprovider="afcachesessionstateprovider">   <providers>     <add name="afcachesessionstateprovider" type="microsoft.web.distributedcache.distributedcachesessionstatestoreprovider, microsoft.web.distributedcache" cachename="default" datacacheclientname="default" applicationname="afcachesessionstate"/>   </providers> </sessionstate> 

this stores asp.net session state in cache.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -