Cursor Prompt: Optimize App Performance
When to Use This Prompt
Use this when your app feels slow, Lighthouse scores are below 80, or users complain about loading times.
The Prompt
Optimize this Next.js application for performance: 1. Add React.memo() to components that re-render unnecessarily 2. Implement code splitting with dynamic imports for heavy components 3. Optimize images: convert to WebP, add proper width/height, use next/image 4. Add loading skeletons for async data 5. Implement virtual scrolling for long lists (>100 items) 6. Move heavy computations to Web Workers or useMemo 7. Add proper caching headers for static assets 8. Minimize bundle size: identify and remove unused dependencies Measure before/after using Lighthouse scores. Target: Performance > 90.
What to Customize
Focus on the bottlenecks specific to your app. Not all optimizations are needed for every project.
Expected Output
Optimized components, lazy-loaded routes, and proper caching. Expect Lighthouse scores to improve by 15-30 points.