Wednesday, February 9, 2011

EPiServer Event Cache Invalidation in a Multi-Server Environment

When multiple servers are setup in EPiServer CMS for load balancing that share a SQL Server backend one common issue is making certain that change from the admin on any server will invalidate the correct cache objects on all servers.

This is all setup very easily within web.config and can be tested quite easily.

I’m not going to go through and explain the full scope of what is going on to accomplish this, but you should know it uses the UDP protocol, multicasting, and Microsoft WCF.  For more information you can visit:

The EPiServer Tech-Note on Configuration

Relevant web.config Sections:

   1: <system.servicemodel>
   2:     <client>
   3:         <endpoint bindingconfiguration="RemoteEventsBinding"
   4:             name="RemoteEventServiceClientEndPoint" 
   5:             address="soap.udp://" 
   6:             binding="customBinding"
   7:             contract="EPiServer.Events.ServiceModel.IEventReplication" />
   8:     </client>
   9:     <bindings>
  10:         <custombinding>
  11:             <binding name="RemoteEventsBinding">
  12:                 <binarymessageencoding />
  13:                 <udptransport multicast="true" />
  14:             </binding>
  15:         </custombinding>
  16:     </bindings>
  17:     <extensions>
  18:         <bindingelementextensions>
  19:             <add name="udpTransport" type="Microsoft.ServiceModel.Samples.UdpTransportElement, EPiServer.Events" />
  20:         </bindingelementextensions>
  21:     </extensions>
  22:     <services>
  23:         <service name="EPiServer.Events.Remote.EventReplication">
  24:             <endpoint bindingconfiguration="RemoteEventsBinding" name="RemoteEventServiceEndPoint" address="soap.udp://" binding="customBinding" contract="EPiServer.Events.ServiceModel.IEventReplication" />
  25:         </service>
  26:     </services>
  27: </system.servicemodel>
  28: <system.webserver>
  29:     <modules runallmanagedmodulesforallrequests="true">
  30:         <add name="EventSubscriberHostModule" type="EPiServer.EventSubscriberHostModule, EPiServer" />
  31:     </modules>
  32: </system.webserver>

No comments:

Post a Comment