Development Workflow

Build a Reliable Editorial Preview System

Let editors review unpublished content safely without exposing drafts to the public.

Preview links are useful only when they show the intended revision and do not turn unpublished content into publicly accessible data.

Bind previews to a specific revision

A preview should identify the content item and the exact draft revision being reviewed. If the editor changes the draft after sharing a link, the preview should not silently change unless that behavior is intentional.

Use short-lived, high-entropy tokens or authenticated preview sessions. Do not expose sequential database IDs as authorization.

Protect preview access

Validate token expiry, intended content, and permitted operations. Preview endpoints should not be indexed, cached publicly, or included in sitemaps. Use appropriate noindex directives and private cache controls.

Avoid putting sensitive preview tokens in analytics events, referrer headers, or application logs. Where possible, exchange a token for a short-lived server-side session and redirect to a clean URL.

Match production rendering

Preview should use the same templates and rendering pipeline as the published page. The differences should be limited to draft data and preview-specific indicators. This reduces the chance that editors approve a layout that differs from production.

Implementation checklist

  • Bind preview to a specific revision.
  • Use high-entropy, expiring authorization.
  • Prevent indexing and public caching.
  • Avoid leaking tokens into logs or referrers.
  • Render through the production template pipeline.
Share this page Help other developers discover this resource.