Who this is for. Developers and site builders who schedule content, or whose jobs and search results must follow a schedule. After this page you can schedule a record to go live and to expire, and say what happens, and when, at each crossing.
Scheduling a record
- To go live later, set the record's published date in the future. Until then gate one hides it (see Published, active and draft: the two gates); from that moment the same condition lets it through. Nothing is saved when the date passes: going live is purely a matter of the clock.
- To come down later, set
unpublishAt. The admin has no field for it, so it is set through the API. It is honoured for pages, books, units and book pages only. Once the date has passed, the worker below unpublishes the record.
Through the API the two fields are published and unpublishAt on the record; Versioned content and the live revision explains both from the API's side.
The worker
One scheduled task, processScheduledPublishing, runs every minute on every site (cron * * * * *). It handles the records whose publish or unpublish date has been crossed since it last ran: it updates the search index, purges cached responses and raises the record's update event, which jobs listen to.
| Going live | Expiring | |
|---|---|---|
| Trigger | The published date has passed | The unpublish date has passed |
| What it writes | Nothing: the record is already visible by the clock | Unpublishes the record and consumes its unpublish date |
| Then | Raises the update event (search index, jobs) and clears the response cache | The same |
| Record types | Blogs, blog posts, books, units, book pages, FAQ questions, pages, product descriptions | Books, units, book pages, pages |
| Older dates | Not replayed (see below) | Handled however old, in batches of 1,000; a record not yet handled is retried on the next run |
A record becomes visible to a fresh query as soon as its published date passes, whether or not the worker has run. What waits for the worker is everything around the record: the search index, cached responses and jobs.
The worker keeps a mark of how far it has got and moves it forward before it handles each window, so a go-live crossing never fires its job twice. The mark starts at the current window when it is first set up, so a published date that was already in the past before then gets no go-live handling: no search update and no job. To bring the search index up to date after that, use "Reindex All" in the admin.