Indie Affiliate already had program pages, articles, images, tags, referral links, and years of awkward URL decisions. Rebuilding it without an archive would have turned the old site into broken links with a nicer design.
I made the archive repeatable. It records each page as HTML and plain text, plus source hashes, content hashes, tags, media references, and outbound destinations. If the source has not changed, another archive run produces the same import.
The new Cloudflare app keeps public content in D1. Media goes to private object storage and gets one optimized working version during import.
Referral links get their own records. The app keeps the canonical URL, host, path, query values, referral code, coupon, and link type. A redirect is much easier to inspect when it is not a mystery URL buried in an article.
D1 is the source of truth. KV holds versioned public caches that can be rebuilt after a write. Admin edits create revision snapshots. New HTML goes through an allowlist before publication. Owner access uses a separate protected login rather than hidden controls on the public site.
Search, filters, shareable views, program details, publishing, and a commission calculator are the visible upgrades. The archive and the redirect record are why those upgrades do not erase the site that was already there.