I'm working on a project where we needed to create and publish many, many nodes, so we're using "SaveAndPublish" which is quite expensive in terms of performance.
How can we improve the performance of SaveAndPublish?
I remember a while back in V7 I had this issue, and I think a low tech workaround was to only call 'Save' on the ContentService, and then once my import was complete, 'publish' the section that was imported.
I'm not sure if this would 'do it' similar in V8 world, but there is a
SaveAndPublishBranch method on the ContentService that takes in a content node, and an optional 'force' parameter, that forces everything under that item to be published.
so speculating, that using Save each time you create your many many nodes and then at the end call SaveAndPublishBranch... Would that be quicker overall?
Best Practices Running SaveAndPublish
Hello, community,
I'm working on a project where we needed to create and publish many, many nodes, so we're using "SaveAndPublish" which is quite expensive in terms of performance.
How can we improve the performance of SaveAndPublish?
Thanks, Alex
Hi Alex
I remember a while back in V7 I had this issue, and I think a low tech workaround was to only call 'Save' on the ContentService, and then once my import was complete, 'publish' the section that was imported.
I'm not sure if this would 'do it' similar in V8 world, but there is a SaveAndPublishBranch method on the ContentService that takes in a content node, and an optional 'force' parameter, that forces everything under that item to be published.
https://github.com/umbraco/Umbraco-CMS/blob/e626fca2432582f052cb13654eedd9e60ef8723f/src/Umbraco.Core/Services/ContentService.cs#L1941
so speculating, that using Save each time you create your many many nodes and then at the end call SaveAndPublishBranch... Would that be quicker overall?
Just a bit of a guess!
regards marc
is working on a reply...