Live for Craft CMS

Configuration

Settings live under Settings → Plugins → Live, or Live → Settings for admins. Every one of them can also be set in config/live.php, which wins over the control panel.

The defaults are the ones to run a public live blog on. Most sites change nothing.

Snapshots

SettingDefaultWhat it does
snapshotsEnabledtrueEach publish writes static JSON into the web root, so readers poll a file instead of waking Craft. Turn it off only if the web root isn't writable.
snapshotPath@webroot/live-feedWhere the files are written. Must be inside the web root. Accepts aliases and environment variables.
snapshotUrl@web/live-feedThe URL those files are served from. Accepts aliases and environment variables.
headWindow20How many recent updates head.json lists inline. Larger means a reader can catch up further without a reload.
prerenderHtmltrueRender each update's HTML at publish time through your own template, so appended updates match the page exactly.
updateTemplate''Site template used to render one update. Empty means live/_update.

With snapshots on, both snapshotPath and snapshotUrl are required: snapshotting to nowhere is a silent no-op, so the settings screen refuses it.

Reading

SettingDefaultWhat it does
pollInterval5Seconds between reader checks (1–300). Also how long a CDN may hold head.json.
composerPollInterval8Seconds between control-panel refreshes, so editors see each other's updates (2–300).
invalidateOwnerCachesfalseWhether a publish also clears the entry's template caches. Off, because the point is that the page stays cached while updates arrive around it.
timestampFormatH:iPHP date format for timestamps in the shipped templates.
bodyAllowedHtml''HTMLPurifier HTML.Allowed string for update bodies. Empty means Live's own list: what the composer can produce, plus links and images.

Editing (Pro)

SettingDefaultWhat it does
presenceEnabledtrueShow who else is in the composer.
presenceTtl60Seconds without a heartbeat before an editor is treated as gone (15–3600).

Server-sent events (Pro)

SettingDefaultWhat it does
sseEnabledfalsePush updates over an open connection instead of waiting for the next poll. Read the note on SSE before turning it on.
sseMaxClients50Streams beyond this are turned away and fall back to polling.
sseMaxDuration30Seconds before a stream asks the client to reconnect.
ssePollInterval500Milliseconds between checks inside an open stream.

CDN purging (Pro)

SettingDefaultWhat it does
purgeDrivernonenone, cloudflare, fastly or webhook.
purgeZoneIdnullCloudflare zone ID.
purgeTokennullCloudflare or Fastly API token. Accepts an environment variable — store it in one.
purgeUrlnullWebhook URL. Live POSTs {"urls": [...]} to it.
purgeThrottle60Seconds between purges of the same post, however many updates land in between (5–3600).

What gets purged, and why so rarely, is in Delivery.

Field settings

Each Live field has its own options, under the field's settings:

OptionDefaultWhat it does
Update typesallWhich kinds of update this feed accepts. Leave all unchecked to allow every type.
OrderNewest firstNewest first reads like a news feed; oldest first reads like a commentary.
Updates per page50How many updates the composer loads at a time (5–500).
Show other editorsonShow who else has this post open (Pro).
Allow scheduled updatesoffOffer a "post at" time in the composer (Pro).

config/live.php

Anything in this file overrides what is saved in the control panel. The settings screen does not mark overridden fields, so if a change there seems to do nothing, check this file first. It takes the usual multi-environment shape:

<?php

use craft\helpers\App;

return [
    '*' => [
        'pollInterval' => 5,
        'headWindow' => 20,
    ],
    'production' => [
        'snapshotUrl' => 'https://cdn.example.com/live-feed',
        'purgeDriver' => 'cloudflare',
        'purgeZoneId' => App::env('CLOUDFLARE_ZONE_ID'),
        'purgeToken' => '$CLOUDFLARE_API_TOKEN',
    ],
    'dev' => [
        'purgeDriver' => 'none',
    ],
];

Environment variables

snapshotPath, snapshotUrl and purgeToken are resolved through Craft's environment variable parsing, so $LIVE_SNAPSHOT_URL or @web/live-feed both work, whether typed in the control panel or set in config/live.php.

For the Cloudflare zone ID and the webhook URL, read the variable in config/live.php with App::env(), as above, so the resolved value is what Live sees.