Clearing Cache in Multi-CM Sitecore Environments

Hello folks ,

Cache cleaning is an essential part of any architecture or website, and Sitecore makes it simple and effective.

Sitecore manages this with various events. In this blog, we will focus on the Publish:End:Remote event for multiple cm in 1 web app.

Issue

Our Sitecore CM (PaaS hosting) handles heavy traffic, so clearing the cache is crucial. Since we have multiple CMs, we needed a way to ensure the cache is cleared across all of them.

Solution

Remote publish end event will be able to clear the cache on all the CM servers. You need to make sure the scalability setting for multiple CM servers are set properly.

When configuring multiple CM server, only one CM instance will be responsible for publishing. In order to configure the same, you need to provide following configuration on CM servers.

  1. Assign each CM server, a instance name based on the machine name plus the IIS server name. You must ensure that each CM instance has a unique name.
    <setting name="InstanceName"><br>  
    <patch:attribute name="value"><your unique CM instance name> 
    <br>   
    </patch:attribute><br>
    </setting>
    

    2. Only one CM instance can perform publishing. You must ensure that each CM instance points to the publishing CM instance.

      <setting name="Publishing.PublishingInstance"><br>    
      <patch:attribute name="value"><your publishing CM instance name> <br>    
      </patch:attribute><br>
      </setting>
      

      Note: On publishing instance server, above setting Publishing.PublishingInstance should be empty.

      Conclusion

      Efficient cache management is critical in a multi-CM environment to ensure consistent performance and reliability. The Publishing:End:Remote event simplifies this by enabling cache clearance across all CM servers, provided the scalability settings are configured correctly.

      By assigning unique InstanceName values and properly setting the Publishing.PublishingInstance, you can designate a primary publishing CM and ensure seamless synchronization between instances. This setup ensures optimal performance and consistent content delivery, even under heavy traffic.

      You can find more details for the same here.

      Happy coding 😊

      Leave a comment

      I’m Garima

      a Sitecore Developer with 8 years of overall experience, with the last 5 years focused deeply on Sitecore. I’m certified in Sitecore 9, Sitecore 10, Sitecore XM Cloud and Sitecore AI CMS for Developers, and bring hands-on expertise across Sitecore CDP, Content Hub, and personalization strategies — especially in headless architectures.

      My tech stack includes strong experience with .NET, JavaScript, React, and Next.js, allowing me to build scalable and high-performing digital experiences.

      🧠 Currently Learning:
      I’m expanding my skill set in the areas of Generative AI, Google Cloud, and Machine Learning fundamentals — with a focus on how these technologies can power future-ready personalization and intelligent content delivery in composable DXP solutions.

      🔗 Always eager to learn, adapt, and collaborate — building smarter digital solutions one sprint at a time.

      Google Cloud Logo

      My Google Cloud Learning Journey 🚀

      I’m actively learning and earning certifications through Google Cloud Skills Boost — focused on Generative AI, Cloud, and more!

      🔗 View My Cloud Skills Boost Profile

      Archives

      Recent Posts

      Let’s connect

      AI architecture caching CDP cli container containers Data Source debug developer devops docker docker desktop droplink droptree Error GIT github headless javascript leadership mentor mentorship multilist NEXT partial design path personalize powershell programming publishing Push REact runtime error services Sitecore Sitecore CDP sitecore community SUGKolkata technology treelist validation validation rules web-development xm-cloud