Web Performance + Assets Cheatsheet
Ship fast pages with smart image, font, and layout decisions.
Images and Media
Use WebP or AVIFModern formats cut file size with little quality loss.
Export at 1x and 2xKeep high-DPI screens crisp without oversizing.
loading="lazy" decoding="async"Defer below-the-fold images and decode off the main thread.
fetchpriority="high"Prioritize hero images or key visuals.
Responsive Images
srcset="image-640.webp 640w, image-1280.webp 1280w"Let the browser pick the right image size.
sizes="(max-width: 768px) 100vw, 50vw"Describe the rendered size so it can choose correctly.
<picture> with source typesFallback to PNG or JPG when needed.
Fonts
font-display: swap;Avoid invisible text while fonts load.
Subset to needed glyphsShip only the characters you use.
Preload critical fontsLoad body and headline fonts earlier.
CSS and JavaScript Loading
deferLoad scripts after HTML parsing.
asyncLoad independent scripts without blocking.
Inline critical CSSRender above-the-fold content faster.
Layout Stability
width and height attributesReserve space to avoid layout shift.
aspect-ratio: 4 / 3;Keep consistent media boxes without hardcoded heights.
Skeletons or placeholdersShow structure while content loads.
Caching and Delivery
Cache static assets aggressivelyUse hashed file names for long cache lifetimes.
Use a CDN for imagesServe assets from locations closer to users.
Compress with Brotli or gzipReduce transfer size for HTML, CSS, and JS.
Quick Audit Checklist
Run Lighthouse performance auditTrack LCP, CLS, and overall score.
Check network waterfallSpot heavy assets and slow third parties.
Budget: 200-300KB per pageSet a target to keep pages lean.