Enable gzip or brotli compression — Windsurf
Uncompressed responses waste bandwidth and slow down Core Web Vitals. Brotli is the modern standard — enable it on Vercel, Netlify, or your CDN.
Fixing this in Windsurf
Codeium agentic AI IDE with Cascade
Windsurf Cascade can walk the entire project and apply multi-file edits in one pass. Paste the prompt below into your Windsurf chat and the fix rolls out across the project in one pass.
Using a different tool? Pick your stack:
The prompt for Windsurf
Copy and paste this into your Windsurf chat exactly as-is.
Using Windsurf Cascade, apply these edits across the project in one pass: Enable compression 1. Enable gzip or Brotli compression on your web server / hosting. 2. For Vercel/Netlify this is automatic. For custom servers, configure nginx/Apache gzip.
Why this matters
HTML, CSS, and JavaScript compress extremely well — typically 70-80% smaller. That shaves hundreds of milliseconds off Time to First Byte and LCP, especially on mobile.
Every major host supports this out of the box (Vercel, Netlify, Cloudflare, Replit). Self-hosted? Enable it in nginx/Caddy/Apache config. Brotli is preferable; gzip is the universal fallback.
How to use this prompt in Windsurf
- 1. Open your Windsurf project.
- 2. Copy the prompt above with the copy button.
- 3. Paste into the Windsurf chat and send.
- 4. Review the diff, accept the changes, redeploy.
- 5. Verify the fix using the checklist below.
Common mistakes to avoid
- error_outlineCompressing already-compressed assets (JPEG, PNG, WebP) — waste of CPU.
- error_outlineEnabling compression but not for the right content types — images and PDFs should not be recompressed.
- error_outlineAssuming your host does it automatically without verifying.
How to verify the fix worked
- check_circle`curl -I -H "Accept-Encoding: br" URL` — `Content-Encoding: br` in response.
- check_circleChrome DevTools → Network → response headers show `content-encoding`.
- check_circlehttps://tools.keycdn.com/brotli-test — green check.
Frequently asked questions
gzip or brotli?expand_more
Does it hurt CPU?expand_more
Want all 34 prompts tailored to your Windsurf site?
Pantra scans your site in 10 seconds, detects the stack, and generates the exact prompts that apply — only the ones you actually need.
Scan my siteRelated Windsurf prompts
Fix Core Web Vitals (LCP, CLS, INP) — Windsurf
Prompt to address Google Core Web Vitals thresholds: LCP < 2.5s, CLS < 0.1, INP < 200ms. Works in any AI-coded stack.
PerformanceImprove Largest Contentful Paint (LCP) — Windsurf
Prompt to get LCP under 2.5 seconds — preload the hero image, cut render-blocking, use a proper CDN.
TechnicalAdd the viewport meta tag — Windsurf
Prompt to add the mobile-friendly viewport meta tag — required for Google mobile-first indexing.
TechnicalSet the lang attribute on <html> — Windsurf
Prompt to add lang="en" or lang="de" to the <html> tag for accessibility and SEO.