How-to
Rebuild your site when entries change
To rebuild your site when content changes, create an automation that runs when an entry is published, unpublished, or edited, and give it a webhook step that calls your site's rebuild address. To avoid a rebuild for every single edit, have the trigger collect changes into one run every 15, 30, 60, or 240 minutes, or once a day.
To rebuild your site when content changes, create an automation that runs when an entry is published, unpublished, or edited, and give it a webhook step that calls your site's rebuild address. To avoid a rebuild for every single edit, have the trigger collect changes into one run every 15, 30, 60, or 240 minutes, or once a day.
Requirements
- A role that can edit automations.
- A rebuild or cache-clear address from your hosting provider or framework.
Steps
- Create an automation on the collection the site reads. A furniture retailer uses its Products collection.
- Choose the trigger.
- Status changed: fires when an entry is published or unpublished. Enough for most sites.
- Entry updated: fires on any edit, for sites that show content that changes after publishing, such as prices or stock.
- Choose the sources. Include manual edits and imports if people change products in Sonta or by CSV; by default an entry trigger listens only to changes coming from the website.
- Batch the changes, if edits come in bursts. Set the trigger to deliver a summary every 15, 30, 60, or 240 minutes, or daily at a set time, instead of one run per change. A catalog update of 200 products then causes one rebuild, not 200.
- Add a webhook step with your rebuild address, the method your host expects, and any headers or body it needs.
- Add retries to the webhook step, so a moment of downtime at your host does not lose a rebuild.
- Test, then activate. A dry run shows the call without sending it; see Inspect an automation run.
Notes and limitations
- Scheduled start dates do not fire a trigger. An entry scheduled to go live at a future time is already published, so there is no status change when the time arrives. If your site caches pages, also rebuild on a schedule, such as every morning, with a scheduled automation.
- Batched runs have no single entry. A summary run carries the count and list of changed entries rather than one triggering entry, which is fine for a rebuild call.
- Webhooks in the other direction, from your site into Sonta, are covered in Webhooks in and out.
Related
If content still does not appear after a rebuild, see My entry does not appear on the site.
Frequently asked questions
How do I avoid a rebuild for every small edit?
Set the trigger to batch changes into one run every 15, 30, 60, or 240 minutes, or daily.
Does a scheduled entry trigger a rebuild when it goes live?
No. A scheduled entry is already published, so no status change fires when its start time arrives. Add a scheduled rebuild as well.
Why does editing a product in Sonta not start the rebuild?
Include manual edits and imports in the trigger's sources; by default it listens only to the website.