Largest Contentful Paint (LCP < 2.5s)
LCP measures the render time of the largest visual element in the viewport (typically hero imagery or h1 headlines). To achieve sub-second LCP, avoid render-blocking CSS frameworks and convert heavy PNG/JPEG assets into modern WebP format.
Deploying static SSG builds via global edge CDNs (like Cloudflare Pages) drops Time to First Byte (TTFB) below 50ms worldwide.
Interaction to Next Paint (INP < 200ms)
Replacing legacy First Input Delay (FID), INP evaluates overall user responsiveness across every click, tap, and keyboard interaction throughout the entire page lifecycle.
Heavy computational tasks (such as PDF compression, image filtering, and syntax parsing) must never execute on the main UI thread. Offloading CPU workloads to background Web Workers ensures UI clicks respond in under 16 milliseconds.
Cumulative Layout Shift (CLS < 0.1)
CLS measures unexpected visual layout jumps that occur when images or third-party banners load without predefined dimensions.
Always declare explicit `width` and `height` aspect-ratio attributes on `<img>` and `<canvas>` elements, and reserve layout slots for dynamic widgets.
Step-by-Step Tutorial
Audit Performance Baseline
Run Google Lighthouse and WebPageTest to record your real-user field data (CrUX).
Offload CPU Tasks to Workers
Move heavy data parsing and cryptography off the main thread into Web Workers.
Optimize Static Assets
Compress all imagery to WebP/AVIF and deploy static SSG exports to global edge networks.
Ready to Try It Yourself?
DocSwift processes everything directly on your device. Fast, safe, and completely free forever.
How helpful was this guide?
Rated 4.9 / 5 by 3,420+ users worldwide
Share with Colleagues & Friends
Help others protect their document privacy
Frequently Asked Questions
What is the acceptable threshold for Interaction to Next Paint (INP)?
Google considers an INP below 200 milliseconds "Good", between 200ms and 500ms "Needs Improvement", and above 500ms "Poor".
Does server-side rendering (SSR) always yield better LCP than static export (SSG)?
No. Static HTML exports (SSG) served from global edge CDNs have significantly faster TTFB than SSR, resulting in superior LCP scores.