Problems publishing? Review your Sitecore scalability settings

Director, Solution Delivery
Valtech

October 03, 2016

You may have run into problems publishing on Sitecore. The issue may relate to your Sitecore scalability settings.

Previously I wrote about reasons why your content may not be live.

Over time I've observed an additional nuance to this scenario and it comes down to a configuration that oftentimes gets overlooked.

Scalability settings

Sitecore is commonly scaled to have separate Sitecore instances for content authoring (typically one instance which is also responsible for publishing) and content delivery (typically one or more instances). In such a scenario, Sitecore has a configuration file that should be enabled and patched differently depending on the role the instance fulfills.

The configuration file in question is the ScalabilitySettings.config file. By default it is disabled, but it should be enabled in a scaled environment.

Simply enabling the file is not enough. Two of the settings, InstanceName and Publishing.PublishingInstance, should be patched for the role of the Sitecore instance in the environment. These settings play a vital role in cache clearing on the content delivery server after a publication. When a publication occurs on the content authoring instance, the content delivery nodes need to know that a publication has occurred and that they should clear their HTML cache. For this to work properly, the configured settings should reflect the following:

Content authoring instance:

InstanceName = CA

Publishing.PublishingInstance = CA

Content delivery instance 1:

InstanceName = CD1

Publishing.PublishingInstance = CA

Content delivery instance X:

InstanceName = CDX

Publishing.PublishingInstance = CA

Note: The InstanceName setting can be any value, as long as the usage of the name is aligned across the different servers. If left empty, the default value is the machine name.

Upon reviewing the settings, you'll notice that each instance has a unique InstanceName but the Publishing.PublishingInstance refers to the CA value in all cases. The Publishing.PublishingInstance identifies which instance is responsible for publishing and subsequently allows the other instances to monitor the event queue and determine that a publication has occurred. When the publication is logged to queue, the content delivery nodes know that they should clear their cache.

HtmlCacheClearer

When a content delivery node detects a publication has occurred, it fires its own publish:end:remote event which contains the HtmlCacheClearer functionality. This event clears the cache of the default website site definition. It is typical however, to create a custom site definition. It is important that this section is patched to include your custom sites, otherwise your site cache will not be cleared.

If your build is not scaled, the publish:end event should be updated to include your custom sites.

Capture - Publishing and your Sitecore scalability settings

Contact us

We would love to hear from you! Please fill out the form and the nearest person from office will contact you.

Let's reinvent the future