## PERFORMANCE GUIDE ### 1. Performance Philosophy Performance isn't a luxury. It's a requirement. At ego.cx, every millisecond counts because every millisecond affects user experience, conversion, and search engine ranking. **Our principles:** - **Fast by default** — performance is designed, not patched - **Measured and monitored** — you can't improve what you don't measure - **Accessible** — performance is also inclusivity --- ### 2. Key Metrics | Metric | Target | Tool | |--------|--------|------| | **LCP** (Largest Contentful Paint) | < 2.5s | Lighthouse / Web Vitals | | **FID** (First Input Delay) | < 100ms | Lighthouse / Web Vitals | | **CLS** (Cumulative Layout Shift) | < 0.1 | Lighthouse / Web Vitals | | **TTFB** (Time to First Byte) | < 200ms | Lighthouse / Web Vitals | | **Total load time** | < 3s | PageSpeed Insights | | **Page size** | < 2MB | DevTools / WebPageTest | --- ### 3. Best Practices #### 3.1. Images - **Format:** WebP or AVIF (with JPEG/PNG fallback) - **Compression:** optimized without quality loss - **Size:** responsive (srcset) - **Lazy loading:** native (`loading="lazy"`) + Intersection Observer for below‑fold images #### 3.2. Code - **Minify:** CSS, JS, HTML - **Bundling:** group but don't over‑bundle - **Tree shaking:** remove unused code - **Code splitting:** load only what's needed #### 3.3. Fonts - **Asynchronous loading:** `font-display: swap` - **Subset:** only the necessary characters - **Preload:** for critical fonts #### 3.4. Caching - **CDN:** for static content delivery - **Browser cache:** with `Cache-Control` headers - **Service Worker:** for offline caching #### 3.5. Third‑parties - **Deferred loading:** third‑party scripts (analytics, videos) - **Self‑hosted:** when possible - **Light libraries:** avoid heavy dependencies --- ### 4. Monitoring Tools - **Lighthouse:** audit in development and production - **PageSpeed Insights:** quick view from Google - **Web Vitals:** real‑time monitoring (Chrome User Experience Report) - **WebPageTest:** detailed analysis from multiple locations - **Sentry:** error and performance monitoring --- ### 5. Performance Checklist **Before deployment:** - [ ] Images optimized and in WebP/AVIF - [ ] CSS and JS minified - [ ] Lazy loading configured - [ ] Fonts preloaded with `font-display: swap` - [ ] Cache configured - [ ] CDN active - [ ] Third‑parties loaded deferred **Post‑deployment:** - [ ] Lighthouse > 90 in Performance - [ ] Core Web Vitals within thresholds - [ ] Load time < 3s - [ ] Console errors minimized --- ### 6. Continuous Improvement Plan | Frequency | Action | |-----------|--------| | **Weekly** | Review Web Vitals metrics | | **Monthly** | Lighthouse and PageSpeed audit | | **Quarterly** | Dependency review and updates | | **Annual** | Full performance and architecture audit | --- *Last updated: 2026-07-10* --- *— Fernando José Caicedo Albarello* *Founder, EgoCX*