Sitecore Best Practice Series:
|Use SPE for platform customizations and reporting instead of .Net
|Reduce future maintenance by making your customizations and automations less intrusive to the platform with SPE.
|Package modules as NuGet packages
|Serilize module content using SCS and include it with module code in the XM Cloud solution. Packaging modules using NuGet or other package managers allows to easily add a module to your implementation and reduce environment creation and solution deployment time.
|Understand the underlying principles of Helix and apply them as needed
|Helix is a combination of architectural design princples that touch content and code architecture. While the code architecture is no longer applicable to head implementations, many content structure and general development principles are timeless, make sure to follow the relevant ones.
|Implement redirect functionality at the Edge
|While redirect rules can continue to be managed in Sitecore XMC, implement a middleware layr in Vercel to cache the redirect rules and execute them at the Edge.
|Use Vercel’s image optimization
|Take advantage of performance gains and reduce operation overhead related to generating next gen image formats by using Vercel's automated image conversion to webp.
|Create business logic, APIs, jobs outside of XM Cloud solution
|Avoid deploying data processing logic, jobs, or creating custom APIs hosted in the XMC instance to avoid breaking changes and issues with platform performance. It is possible that Sitecore will implement a gate diallowing these types platform customizations in the future.
|Avoid customizing the XMC platform as much as possible
|Export platform customizations out of the solution into external serverless applications being called by XMC webhooks and using XMC's APIs to manage the platform and manipulate content to significantly reduce the amoutn of future maintenance and potential breaking changes with major platform upgrades.
|Avoid circular referenced in content items
|Circular content references like item 1->item 2->item 1 may cause significant delays in publishing to Edge in XMC.
|Use rendering parameters to expose functional and visual component customizations
|The new pages tool makes rendering parameters a code piece in content author experience dedicating the entire right section of the editor to it. Make sure to follow the Headless SXA guidelines in exposing component configration and styling for content authors to enable self-service.
|Remove ghost code from the Sitecore XMC Head Foundation solution
|While the Sitecore XMC Head Foundation solution (https://github.com/sitecorelabs/xmcloud-foundation-head) is the right place to start building an XMC implementation, it it likely you will not make use of all the code in the repository. Reduce maintenance by removing all unused "ghost code".
|Use the Sitecore XMC Head Foundation repository
|Use the startup project repository from Sitecore for your projects: https://github.com/sitecorelabs/xmcloud-foundation-head. The cosde structure lays out some recommended architectural practices and provides examples of implemetations that may help reduce development time.
|Do not store secrets in Sitecore XM Cloud Deploy
|While XM Cloud Deploy is a good place to store environmet-specific configurations, avoid storing secrets in the application and instead use secure cloud stores like Azure Vault. Azure Vault allows for centralized secret management with additional tools for streamlining and automating relevant operations, like key rotations, for instance.
|Build the “head” of the application using the Edge
|Frontend developers do not need to setup a local instance of Sitecore XMC unless they work directly with content and templates, and rather work against the Edge in a cloud XMC instance. This practice helps reduce the effort going into a local development machine setup, and speeds up the development flow by removing the need to maintain the local XMC instance.
|Retain as much .Net code as possible when migrating to XMC
|When moving from another .Net platform or modernizing from Sitecore XP to XM Cloud, try to keep as much of the existing .Net code as possible, because .Net performs faster than Next.js when it comes to jobs, processing, APIs, and business logic in general. This practice will also help keep the cost of migration down.