Delay when publishing a page (via code not backoffice)
Hello,
I have a piece of custom code that dynamically creates and publishes a page on a AjaxBeginForm submit.
The problem I have is that it takes the best part of 22 seconds for the publish to complete and then show a completed message. Is there a way to speed up this publishing process?
I'm using CreateContentWithIdentity to create the page and PublishWithStatus to publish.
I use ContentService.CreateContent for creation and ContentService.SaveAndPublishWithStatus for publishing and it takes like 1 second to complete on pretty big site.
Do you have slow db connection maybe? Or server is really not strong enough?
Delay when publishing a page (via code not backoffice)
Hello,
I have a piece of custom code that dynamically creates and publishes a page on a AjaxBeginForm submit.
The problem I have is that it takes the best part of 22 seconds for the publish to complete and then show a completed message. Is there a way to speed up this publishing process?
I'm using CreateContentWithIdentity to create the page and PublishWithStatus to publish.
Many thanks
Paul
Hi Paul
I use ContentService.CreateContent for creation and ContentService.SaveAndPublishWithStatus for publishing and it takes like 1 second to complete on pretty big site.
Do you have slow db connection maybe? Or server is really not strong enough?
Thanks,
Alex
Hi Alex,
You could very well be right there, I don't think it's a particularly powerful server.
What is the difference between ContentService.CreateContent and CreateContentWithIdentity?
Thanks
Paul
As documentation said:
https://our.umbraco.org/documentation/reference/management/services/contentservice#createcontentstring-name-int-parentid-string-contenttypealias-int-userid--0
CreateContent - Creates a Content object using the alias of the ContentType that this Content is based on.
CreateContentWithIdentity - Creates and saves an Content object using the alias ContentType that this Content should be based on.
The difference is in Saving after creation, so basically you save the same content 2 times.
Try to use "CreateContent" method, it's just creating a content.
Thanks,
Alex
No difference I'm afraid took roughly the same amount of time. Maybe it is the server spec.
22 is really to much time.
What properties are you using?
MAybe some content events?
Hi Paul
Did you solve the issue? Can you share with our community?
Alex
I'm afraid not. All I could do was manage the delay, by showing progress wheel and disabling the submit button until the job had finished.
Do you have anything hooked into the publish event (or others) that might be slowing it down?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.