Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to publish at specific time in Sitecore

Tags:

sitecore

As far as I can tell, out-of-box Sitecore doesn't come with a way to publish something at a specific time. By that I mean an EXACT time of day.

As I understand it, you turn on the publishing agent by setting an interval...let's say every half hour (doesn't seem like it would be a good idea to auto-publish more often than that). Then you have your authors set publishing restrictions on items. When that restriction passes, the item is published the next time the publishing agent runs. Correct?

The above scenario doesn't allow for something being published at a specific time of day. If I have a page that needs to go live at 8am tomorrow, it's possible that it wouldn't be live until around 8:30am depending on when the interval is run in relationship to 8am. Do I have that correct?

What is the best approach to set things up so that authors can publish items at specific times of day?

like image 488
Scott Avatar asked Apr 02 '15 01:04

Scott


1 Answers

You are correct on the publishing agent. All of Sitecore's agents are interval based, and are not guaranteed to run at a specific time. You can crank the interval way down, but since publishing is a serial task for the most part, If your interval is, say, 5 minutes, and your site publish takes 7 minutes, you'll get a pileup of publish jobs (as one is put on the queue every 5min).

The only way to guaranty a publish occurs at a specific time is to have someone do it at that time via the content editor. Automation-wise, Sitecore doesn't have anything for this. In the past, where clock time was crucial for a job to run, I've seen Windows scheduled tasks run and hit a URL on the site to kick it off.

The other approach you could take for content if time of day is that critical, is to have a datetime field on a base template, then have a httpBeginRequest pipeline step that runs after the ItemResolver. Have that step read the time on the field, then about the pipeline if the item isn't "live" yet.

like image 138
Derek Dysart Avatar answered Oct 04 '22 15:10

Derek Dysart