Web Packaging R&D Track Plan: Prefetch, Signed Exchanges, and FatPack Evaluation with Telemetry Instrumentation
Executive Summary
This R&D track focuses on evaluating key Web Packaging technologies—Prefetch (resource prefetching for bundles/SXGs), Signed Exchanges (SXG) (cryptographically signed HTTP responses for third-party content distribution), and FatPack (dense, self-contained web app bundles, e.g., via tools like fatpack.js or Web Bundle equivalents)—to measure their performance, adoption, and ecosystem readiness.
Primary Goals:
- Quantify performance gains (e.g., LCP/TTFB improvements, cache efficiency).
- Instrument browser telemetry for real-world usage data.
- Identify blockers (e.g., signature overhead, prefetch prediction accuracy, bundle bloat).
- Deliver actionable recommendations for standardization, implementation, and adoption.
Estimated Duration: 12-16 weeks (scalable based on team size).
Team Size: 3-5 engineers (1 lead, 2 frontend/backend, 1 data/ telemetry, 1 PM).
Budget: Low (open-source Chromium contributions; ~$10K for cloud compute/BigQuery if needed).
Success Metrics: 80% telemetry coverage of key events; ≥10K field data samples; ≥20% perf uplift in benchmarks.
Background
- Prefetch: Enables browsers to speculatively fetch Web Packages (Bundles/SXGs) via
<link rel="prefetch"> or HTTP headers, reducing cold-start latency.
- Signed Exchanges: Allows signed, origin-bound content delivery from CDNs/proxies without CORS, integrated with Web Packaging for secure bundling.
- FatPack: Refers to optimized, monolithic bundles (e.g., single-file HTML/JS/CSS packs) that leverage SXGs and Bundles for edge deployment, minimizing fetch waterfalls.
- Why Now?: Web Packaging is maturing (Chrome 119+ support), but lacks field data. Telemetry will bridge lab benchmarks to production impact.
R&D Phases and Milestones
Phase 1: Research & Planning (Weeks 1-2)
Objectives: Establish baseline, define metrics, and prototype testbeds.
- Review specs (W3C Web Packaging, WHATWG Fetch), impl status (Chromium, Safari), and tools (e.g.,
sxgclient, webpkg, Rollup/Webpack for FatPacks).
- Benchmark lab setups:
| Tech | Metrics | Tools |
|---|
| Prefetch | Hit rate, time-to-prefetch, eviction rate | Lighthouse, WebPageTest |
| SXG | Validation latency, cache hit %, origin mismatches | sxgdebug, Chrome DevTools |
| FatPack | Bundle size, parse/decode time, resource hydration | Bundle analyzer, Chrome TP |
- Define telemetry histograms/UKM (User Cohort Metrics):
WebPackage.Prefetch.SuccessRate (UMA histogram: 0-100%).
SignedExchange.ValidationTime_ms (min/max/avg).
FatPack.BundleSize_MB, FatPack.LoadTimeSavings_pct.
- Error enums:
SignatureMismatch, BundleCorruption, PrefetchAbort.
- Deliverables: Research report, metric schema (JSON proto), test corpus (10 sites/apps packaged).
- Milestone: Approved telemetry CL (Change List) design doc.
Phase 2: Telemetry Instrumentation (Weeks 3-6)
Objectives: Implement non-intrusive logging in Chromium (Blink/Network stack).
- Instrumentation Targets:
| Component | Events | UMA/UKM Keys |
|---|
| Prefetch | Queue/enqueue, fetch start/end, cache store | Prefetch.BundleSize, Prefetch.EffectiveSavings |
| SXG | Signature parse/verify, cert chain validation, response serve | SXG.CacheHitRate, SXG.ErrorType |
| FatPack | Bundle open/parse, subresource extract, fallback to non-pack | FatPack.HydrationTime, FatPack.FallbackRate |
- Patch Blink (
content/browser/loader/, third_party/blink/renderer/) and Network service.
- Use
base::Histogram, ukm::UkmRecorder, field trials for cohorting (e.g., 1% Canary).
- Privacy: Anonymize origins, sample at 0.1-1% globally.
- Synthetic testing: Automate via Telemetry framework (e.g., Speedometer with SXGs).
- Deliverables: Landed CLs in Chromium ToT; local repro dashboard (e.g., via Perf Dashboard).
- Milestone: Telemetry firing verified in chrome://histograms (Canary build).
Phase 3: Deployment & Data Collection (Weeks 7-12)
Objectives: Gather field data with controlled rollouts.
Phase 4: Evaluation & Analysis (Weeks 13-16)
Objectives: Derive insights and recommendations.
- Analysis Framework:
| Eval Type | Focus Areas |
|---|
| Perf | ΔLCP/TTFB (prefetch: +15-30%?); SXG cache: 2x hit rate? FatPack: 50% fewer reqs? |
| Adoption | Usage by top 1K sites; error rates (<1% target). |
| Compat | Cross-browser (Safari/Firefox gaps); mobile vs. desktop. |
| Cost | CPU/battery overhead; bundle inflation risks. |
- Tools: R/Colab for stats, TB v3 for regressions.
- A/B Insights: Compare pack-enabled vs. vanilla (e.g., Prefetch ON saves 200ms median).
- Risks & Mitigations:
| Risk | Mitigation |
|---|
| Low adoption | Incentivize via Google devs, WebPerf workshop. |
| Privacy flags | Audit UKM; P0 review. |
| Impl bugs | Fuzzer tests (OSS-Fuzz); 2-person review. |
- Deliverables:
- Final report (PDF/Google Doc): Exec summary, charts, raw data links.
- Prototype demo (e.g., FatPack PWA on SXGs).
- Standards bug filings (e.g., WHATWG issues).
- Blog post/DOCUPDATE for Chromium docs.
- Milestone: Approved recommendations (e.g., "Enable Prefetch by default if hit rate >70%").
Resources & Next Steps
- Tools/Infra: Chromium src, Depot Tools, BigQuery (perf.waterfall), web.dev/pwa-directory for tests.
- Dependencies: Chromium infra access; optional: CDN partners (Cloudflare/Fastly for SXG hosting).
- Kickoff: Week 0 all-hands; bi-weekly syncs.
- Extensions: Phase 5 (opt): Integration with Service Workers, streaming Bundles.
This plan is data-driven, incremental, and aligned with browser evolution. Questions or tweaks? Let's iterate! 🕵️♂️