# In cn TUI mode:"Set up A/B test between main and feature branch on Netlify:- Split traffic 50/50 between branches- Track Core Web Vitals for each variant- Monitor conversion metrics and bounce rate- Enable analytics to measure performance impact- Configure cookie-based visitor persistence- Set test duration for 1000 unique visitors- Auto-conclude test when statistical significance reachedReport winner based on performance + conversion metrics"
# In cn TUI mode:"Optimize my Netlify build performance using these features:1. Enable Netlify Cache Plugin for dependency caching - Configure @netlify/plugin-cache for node_modules - Set up custom cache directories for .next/cache or .nuxt - Enable Gatsby's incremental builds if applicable2. Set up Build Plugins from Netlify's ecosystem: - Install @netlify/plugin-lighthouse for performance monitoring - Add netlify-plugin-checklinks to prevent broken links - Configure netlify-plugin-submit-sitemap for SEO3. Implement Conditional Builds: - Skip builds when only docs change (ignore: /docs/**) - Use build.ignore script for custom logic - Set up monorepo-specific build triggers4. Configure concurrent builds for monorepos - Set base directory per package - Use pnpm workspaces or yarn workspacesShow me the netlify.toml configuration and explain each optimization"
# In cn TUI mode:"Analyze and optimize my bundle using Netlify's tools:1. Enable Netlify Bundle Analyzer: - Add @netlify/plugin-bundle-analyzer to plugins - Configure size thresholds in netlify.toml - Generate visual bundle reports2. Set up Asset Optimization: - Enable automatic JS minification - Configure CSS optimization - Turn on HTML minification - Set up image processing pipeline3. Implement Smart Code Splitting: - Analyze current chunks with the bundle analyzer - Identify components over 50KB for splitting - Configure webpack/vite for optimal chunking - Set up route-based code splitting4. Configure Netlify's CDN for optimal delivery: - Set cache headers for static assets - Enable Brotli compression - Configure edge caching rulesGenerate a full report with before/after bundle sizes"
# In cn TUI mode:"Set up Cloudinary image optimization for my Netlify site:- Install @cloudinary/netlify-plugin via MCP- Auto-convert images to WebP with fallbacks- Generate responsive sizes (320w, 640w, 1024w, 1920w)- Add lazy loading for all images- Configure blur-up placeholders- Update netlify.toml with Cloudinary settingsTarget: Reduce image payload by 60-80% and improve LCP"
# In cn TUI mode:"Set up Lighthouse CI with performance budgets for my Netlify site:Requirements:- LCP must be < 2.5 seconds- JavaScript bundle must be < 200KB- Total size < 500KB- Performance score >= 90Setup needed:1. Install @lhci/cli and @netlify/plugin-lighthouse2. Create lighthouserc.js with these budget assertions3. Configure netlify.toml to run checks on all deploys4. Add GitHub status checks to block PRs that exceed budgets5. Create performance dashboard at /lighthouse-reportsPlease configure the complete Lighthouse CI setup with these budgets."
# In cn TUI mode:"Set up comprehensive Real User Monitoring for my Netlify site:1. Configure Netlify Analytics Pro (requires Pro account): - Set up server-side analytics (no JS required) - Track Core Web Vitals (LCP, FID, CLS, INP) - Monitor top pages by performance score - Create custom performance alerts - Configure weekly performance reports2. Integrate Web Vitals tracking: - Install web-vitals library for detailed metrics - Send metrics to Netlify Functions endpoint - Store performance data in Netlify Blobs - Create performance dashboard at /metrics3. Set up Performance Alerts: - Alert when P75 LCP > 3 seconds - Notify if CLS increases by 20% - Monitor JavaScript error rates - Track 404s and broken resources - Send alerts to Slack via Netlify Functions4. Configure Geographic Performance Monitoring: - Use Netlify Edge Functions to track region-specific metrics - Identify slow regions with Edge geo data - Compare performance across CDN nodes - Optimize edge caching for slow regions5. Create Custom Performance Dashboard: - Build dashboard page using Netlify Functions - Display real-time Core Web Vitals - Show performance trends over time - Include browser and device breakdownsShow me the complete implementation with all code and configurations"
注意:Netlify Analytics Pro 需要付费的 Netlify Pro 账户(每个站点每月 19 美元)。上面的提示假设您拥有此计划。对于免费套餐用户,请重点关注步骤 2-5,这些步骤使用 Netlify Functions 和 Edge Functions 构建自定义分析。
# Try these advanced features in cn TUI mode:"Show me how to use Netlify Edge Functions for geo-based personalization""Set up On-Demand Builders for my blog with 5000 posts""Configure Background Functions for image processing"