Problem/Motivation

The first reader after a comment change pays for rebuilding the snapshot. Preparing it in advance can improve refresh latency, but rebuilding after every web response adds unnecessary work on small sites.

Proposed resolution

  • Keep core ACT demand-built. Make anonymous warming optional through the Background submodule.
  • Collect affected host/field pairs transactionally, including old and new locations on moves. Coalesce writes across requests and prepare only configured snapshot variants.
  • Protect rebuilds against concurrent writes and restore account switching reliably.
  • Emit advanced_comment_threads.snapshot_ready only after a current snapshot has been successfully cached. Direct push updates need not wait for a full snapshot.
  • Keep authenticated snapshots demand-built.

Remaining tasks

  • Review the local implementation and draft ADR 0010.
  • Verify coalescing, moves, rollback, concurrent writes, account restoration and subsequent anonymous cache hits.
  • Verify that failed, disabled or uncacheable preparation never emits readiness.
  • Measure and document write overhead and background rebuild cost.

User interface changes

No new UI. Background warming is opt-in through configuration.

API changes

Explicit snapshot preparation and a snapshot-ready event identifying the host, field, variant and generation.

Data model changes

Host generations use existing key/value storage. The optional Background submodule adds a transactional outbox.

Comments

freelock created an issue. See original summary.

freelock’s picture

Title: Rebuild the anonymous snapshot after comment writes; define the "notify after rebuild" contract » Optional background snapshot preparation and snapshot-ready events
Version: 1.0.0-alpha4 » 1.0.x-dev
Issue summary: View changes
Status: Active » Needs review

Updated IS.