1

While publishing a content tree containing several sites, I wondered if the publish process goes down the list as it appears in the tree. For example, if I hit "Publish item" on the content node below, does Sitecore first publish the entire Home page before starting Global Datasource, and then waiting for that to complete before starting Site A, etc?
enter image description here

It would make sense because you have to process in some order, but Sitecore has had reasons in the past for not doing things the way I expect.

Furthermore, how does the behavior change when you select smart publish versus republish. And does "Publish related items" mess all this up if it needs to publish a linked item before the linking item?

2
  • 1
    I would say it that depends also on whether you choose to republish or smart publish and whether publish related items is checked May 28 at 21:07
  • That's a good point. I'm now expanding the question to how would those options alter the behavior as well?
    – apoteet
    May 28 at 21:39
1

In short; you say Sitecore is not doing things the way you expect - when it comes to item publishing order, you should not expect anything. I also fail to see a use case where this should matter, but that's my personal view.

That said, there are a few things is one thing you can expect.

A parent will always be published before its child items. This comes natural from the recursive algorithm you use to traverse a tree from a root node.

Here's a few reasons why you can predict little else.

  1. Workflow status/Publishing Restrictions. Items may get skipped based on their current workflow state and or their individual publishing settings.
  2. Related Items publishing. Related Items gets processed item by item. So the publishing of one item will then "branch off" and publish a series of items that all relate, such as Media Items, Aliases, and whatnot.
  3. Smart vs Full publishing. Not all items will actually get processed, Smart Publishing will skip some of them.
  4. Publishing Service. Works in a way that talking about "order of publishing" doesn't even make sense.
  5. Workbox. If items auto publish while coming out of workflow, they will be published in the order they appear in the Workbox.

And there are likely more reasons.

If you find yourself in a situation where you believe you would need to know the order items get published in, I strongly suggest you rethink your approach to whatever problem you are trying to solve. There are just too many things to consider and Sitecore will definitely not always behave the way you expect here.

2
  • Thank you for the explanation. Don't worry, order of publishing isn't relevant to any technical problem we're facing. The question came from when I sat there waiting for publish to complete. I just idly wondered if the top folder in the tree would finish first, or if Sitecore had its own plans.
    – apoteet
    May 31 at 15:53
  • Heh. Well. I put out a warning because I've seen many development teams get into trouble by assuming they can rely on the publish events. And for most cases, you cannot ;-)
    – Mark Cassidy
    May 31 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.