Performance Tuning for 100/100 Lighthouse
Ultra PDF Editor targets 100/100 Lighthouse scores on both mobile and desktop. The following optimizations align with Chrome’s performance scoring guidance.1
Asset strategy
- Partial hydration: Only the editor island ships JavaScript. Marketing and documentation pages remain static HTML.
- Bundle splitting: pdf.js and pdf-lib live in their own chunk, loaded only when the editor initializes.
- Font loading: Inter, Poppins, and DM Mono load via self-hosted
@fontsourcepackages withfont-display: swapto avoid layout shifts.
Rendering
- Lazy hydration: The React editor uses
client:idleso it waits until the browser is idle before downloading heavy assets. - Canvas reuse: The viewer reuses a single
<canvas>while switching pages to prevent DOM churn.
Caching and compression
- HTTP caching: Static assets ship with long-lived cache-control headers; HTML uses short TTLs so updates propagate.
- Brotli: Cloudflare automatically compresses assets with Brotli for modern browsers.
Runtime monitoring
- Integrate Lighthouse CI via
npm run lhcito enforce score thresholds in CI. - Use Chrome DevTools Performance panel to confirm the editor stays under 16 ms per frame while drawing.
Footnotes
-
Chrome for Developers, Lighthouse performance scoring, developer.chrome.com/docs/lighthouse/performance/performance-scoring/. ↩