Performance Optimization Checklist
Speed up your application with a structured approach to frontend rendering, backend response times, database queries, and infrastructure tuning.
Checklist: Performance Optimization (engineering)
Performance directly impacts user experience, conversion rates, and SEO rankings. This checklist covers the most impactful optimizations across the full stack, from frontend rendering to database query tuning to infrastructure configuration.
Checklist Items
- Measure Core Web Vitals baseline [critical]: Record LCP, FID, and CLS scores before optimization to measure improvement.
- Optimize images and media [critical]: Use modern formats (WebP/AVIF), implement lazy loading, and serve responsive sizes via srcset.
- Identify and fix N+1 queries [critical]: Profile database queries to find N+1 patterns and replace with eager loading or batch queries.
- Enable CDN for static assets [important]: Serve static files from a CDN with appropriate cache headers for global performance.
- Implement server-side caching [important]: Add Redis or Memcached caching for expensive database queries and API responses.
- Optimize JavaScript bundle size [important]: Code-split routes, tree-shake unused imports, and lazy-load non-critical components.
- Add database indexes for slow queries [important]: Analyze query execution plans and add indexes for columns used in WHERE, JOIN, and ORDER BY clauses.
- Enable gzip or brotli compression [recommended]: Compress API responses and static assets with brotli (preferred) or gzip.
- Implement connection pooling [recommended]: Use connection pooling for database and external service connections to reduce connection overhead.
- Set up performance monitoring [recommended]: Install APM tools to track response times, throughput, and error rates in production continuously.
Common Mistakes
- Optimizing without measuring: Always measure before and after optimization. Use Lighthouse, WebPageTest, and APM tools for data-driven decisions.
- Over-caching without invalidation: Every cache needs a clear invalidation strategy. Stale data causes more problems than slow responses.
- Ignoring frontend performance: Backend response times matter less if the frontend takes 5 seconds to render. Optimize both.
Frequently Asked Questions
- What is a good target for page load time?
- Under 2.5 seconds for LCP, under 100ms for FID, and under 0.1 for CLS. These are Google Core Web Vitals thresholds for good scores.
- Should I optimize frontend or backend first?
- Start by measuring. If API responses are fast but pages load slowly, focus on frontend. If APIs are slow, fix backend first.
- How much does a CDN help?
- CDNs typically reduce static asset load times by 50-70% for users far from your origin server. They also reduce server load.