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.
Profiling first: use Performance panel long-task markers before rewriting hot paths.
Caching strategy
Layer
Mechanism
Invalidation
Browser
Cache-Control, ETag, Last-Modified
Versioned filenames; short max-age + immutable for hashed assets
Service worker
Precache + runtime caches
Versioned SW; skip waiting; cleanup old caches
CDN
Edge TTL, stale-while-revalidate
Purge API; cache keys
Application
In-memory + HTTP cache (TanStack Query, etc.)
Keys, TTL, mutation invalidation
flowchart TB
B[Browser cache]
C[CDN edge]
O[Origin]
A[Application cache]
D[(Database)]
U[User request] --> B
B -->|miss| C
C -->|miss| O
O --> A
A --> D
Stale-while-revalidate: serve stale at edge while refreshing in background—good for read-heavy public content with clear freshness rules.
CSS optimization
Concern
Approach
Critical CSS
Inline critical path; defer rest
CSS-in-JS
Runtime cost—prefer zero-runtime or extracted CSS at scale
Containment / layers
Reduce scope of style recalc
Cascade layers
Order and override control without specificity wars
Font optimization
Practice
Detail
Subsetting
Ship only glyphs needed per script
Preload
Critical WOFF2 only; avoid preload storms
font-display
swap / optional trade FOIT vs CLS
Variable fonts
One file, many axes—smaller than many static files when used well
System stack
Fastest first paint for low-brand-risk UI
Network optimization
Topic
Guidance
API responses
Smaller payloads; field selection; compression
GraphQL
Avoid over-fetching; batching; persisted queries
Pagination / virtualization
Limit rows rendered and transferred
WebSocket
Real-time with less polling overhead when appropriate
Monitoring and alerting
Activity
Tooling
RUM
Vendor or open SDK; sample rate; P75/P95
CI regression
Lighthouse CI, bundle size gates
Alerts
Thresholds on field CWV or proxy metrics
Document who owns triage when budgets fail (frontend platform vs feature teams).