This page is part of the ForgeSDLC knowledge base — an AI-assisted, human-directed methodology for taking product work from concept to production. For the core operating model and vocabulary, see Forge SDLC overview and What is ForgeSDLC?.
Frontend optimization strategies
Purpose: Systematic, project-agnostic catalog of loading, rendering, asset, cache, and network optimizations—with workflow, tooling, and anti-patterns.
Treat optimization as a closed loop: measure, find the bottleneck, change one thing, validate, then monitor. Random micro-optimizations without profiling often waste effort and complicate code. Pair lab tools (Lighthouse, DevTools) with field data (RUM, CrUX) when you can.
Loading optimization
Technique
What it does
When it helps
Code splitting
Separate bundles per route/feature
Large apps; unused code off critical path
Tree shaking
Drop unused exports at build
Libraries with side-effect-free ESM
Lazy loading
Load modules/components on demand
Below-fold routes, heavy widgets
Preload / prefetch
Hint browser to fetch early
Next route, critical fonts, hero assets
Compression
gzip/Brotli for text assets
HTML, JS, CSS, SVG
HTTP/2
Multiplexing over one connection
Many small assets
HTTP/3 / QUIC
UDP-based; better loss recovery
High-latency or lossy networks
Real waterfalls parallelize per HTTP/2/3—this is a logical dependency sketch.
Rendering optimization
Topic
Guidance
Virtual DOM
Batch updates; profile—diff cost still exists on large trees
Repaint vs reflow
Reflow reads layout; avoid forced sync layout in loops
CSS containment
contain: layout paint isolates subtree work
content-visibility
Skip rendering off-screen subtrees (with care for scroll height)
will-change
Hint GPU layers sparingly; remove when done
requestAnimationFrame
Align visual updates to frames; avoid layout reads in rAF storms
Trigger
Typical reflow cost
Geometry reads (offsetWidth, getBoundingClientRect) after writes
High—forces layout
Changing width, top, font-size on many nodes
High
transform / opacity
Lower—often compositor-friendly
Image optimization matrix
Dimension
Options
Format
WebP/AVIF for photos; SVG for icons/simple shapes; JPEG fallback strategy where needed
Loading
loading="lazy" below fold; eager + fetchpriority="high" for LCP candidate
Sizing
srcset, sizes, <picture> for art direction
CDN
On-the-fly resize/format negotiation; cache keys per variant
Scenario
Recommendation
Hero photo
AVIF/WebP + explicit dimensions + preload only if LCP
Icons
SVG sprite or icon font with subsetting
User avatars
Small fixed sizes; CDN transforms
JavaScript optimization
Technique
Notes
Bundle analysis
webpack-bundle-analyzer, Rollup/Vite visualizers—find duplicates and heavy deps