# Performance best practices and patterns — Web Performance Optimization

Source: https://www.geekswithgeeks.com/en/web-performance/web-perf-23

> Proven best practices and architectural patterns that consistently deliver high performance.

## JAMstack and static-first architecture

JAMstack: JavaScript, APIs, Markup. Pre-render content, serve static files globally via CDN, use APIs for dynamic data. Benefits: faster response, better security, cheaper scaling. Examples: Next.js, Gatsby, Hugo.

## Edge computing and serverless

Run logic at CDN edge locations near users, not central origin. Reduces latency for dynamic content. Services: Cloudflare Workers, AWS Lambda@Edge, Vercel Edge Functions. Ideal for personalization, A/B testing, real-time data.

## Architecture decisions impact performance

Static-first achieves better FCP/LCP than CSR. SSR helps perceived performance. Edge computing reduces latency. Choose architecture based on content type and users, not technology preference.

Quick check

**Quiz:** What is the key benefit of static-first architecture?

- [ ] Faster FCP and LCP, better security, cheaper scaling
- [ ] More dynamic features
- [ ] Requires more JavaScript
