Skip to content

Public sites perf · Phase 4: hosted CDN adapter #74

Open

Description

@clbotdev

Part of the public-site performance plan (master issue linked above). Depends on Phase 3. This is the only vendor-specific step, and it applies to hosted FrontLit only. The core must not depend on it.

Goal

Put a global edge cache in front of hosted FrontLit, using the Phase 3 purge mode and a first-party adapter.

Tasks

  • Choose the vendor (Cloudflare for SaaS, CloudFront SaaS Manager, Bunny, Fastly, ...). Criteria:
    • custom-hostname TLS at scale, including apex domains (CUSTOM_DOMAIN_A_RECORDS)
    • purge by tag or surrogate key
    • tiered cache / origin shield
    • stale-if-error support
    • preserving the query string in the cache key (_rsc)
    • cost per hostname and per request
  • Write the adapter (Cloudflare, perf(sites): Cloudflare purge adapter and real-user Web Vitals (#74) #145) behind the Phase 3 purge(tags[]) interface.
  • Decide where custom-domain TLS lives: Caddy on-demand TLS (as today) or the vendor's custom-hostname feature. Update apps/sites/docs/custom-domains.md and the domain verification targets.
  • Enable tiered cache / origin shield. Optionally warm the most-visited URLs from the sitemap after a purge.
  • Real-user monitoring: (perf(sites): Cloudflare purge adapter and real-user Web Vitals (#74) #145) a Web Vitals beacon plus cache hit ratio and TTFB dashboards.

Targets

  • Cache hit ratio above 95%.
  • TTFB p75 under 100ms on cache hits.
  • LCP under 1.5s, CLS under 0.1, INP under 200ms.

Activity

  1. clbotdev commented on Oct 25, 2026

    @clbotdev
    ContributorAuthor

    #145 covers the adapter and real-user monitoring. Comparison and recommendation: docs/site-delivery.md §7a.

    Still open, because each needs a decision and a vendor account:

    • Choose the vendor. Recommended: Cloudflare for SaaS. It has Cache-Tag purge on all plans, 100 hostnames included then $0.10 per hostname per month, and free tiered cache. CloudFront bills each purged tag; Bunny reportedly treats a multi-tag header as one tag.
    • Decide where custom-domain TLS lives. Recommended: Cloudflare custom hostnames terminate TLS, and Caddy stays for self-hosting. Apex domains need Cloudflare's Enterprise apex proxying, or customer DNS that flattens CNAMEs.
    • Enable tiered cache. This is a dashboard setting once the zone exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions