# Cloudflare optimization

When your site runs behind Cloudflare, nimo can review read-only settings, suggest edge fixes, save your approval, apply approved safe actions when they are enabled for your account, and require separate approval before rollback.

Canonical URL: https://heynimo.com/docs/cloudflare-optimization
Markdown URL: https://heynimo.com/docs/cloudflare-optimization.md

## AI summary

Explains Cloudflare OAuth, read-only setting review, the three-audit learning phase, supported edge optimization suggestions, explicit approval, apply, rollback approval, and verification.

## Key points

- Connect Cloudflare with read-only OAuth scopes.
- nimo waits for a three-audit baseline before suggestions.
- Supported fixes include image optimization, Brotli, Early Hints, Auto Minify, and Browser Cache TTL.
- Approval saves who approved the change and the test-run details. Apply and rollback are available only through signed-in actions when safe actions are enabled for the account, and Cloudflare must confirm the expected value before success is recorded.

## Sections

### Connect Cloudflare

- Open Settings, go to Integrations, and choose Cloudflare.
- Sign in with Cloudflare and allow account read, analytics read, zone read, and zone settings read scopes.
- nimo needs enough audit history before it suggests infrastructure changes.

### Learning phase

- nimo waits for a three-audit baseline before suggesting Cloudflare changes.
- The learning phase helps nimo avoid changing settings because of one noisy run.

### Supported fixes

- Image Polish and WebP can improve image delivery at the edge when images are a real bottleneck.
- Brotli compression can compress text assets so pages transfer less data.
- Early Hints can let browsers begin loading important resources sooner.
- Auto Minify can minify HTML, CSS, or JavaScript when it is safe for the site.
- Browser Cache TTL can improve repeat visits by caching static assets longer.

### Approve, apply, and roll back

- nimo can save that you approved a suggested Cloudflare change so the recommendation history is clear.
- Approval prepares an expiring approval request with test-run details; it does not change Cloudflare settings from public chat.
- When safe actions are enabled for the account, a signed-in apply action can apply an approved request through backend code.
- nimo records apply success only when Cloudflare confirms the desired value.
- Rollback is separate: nimo requires a rollback plan, an available rollback reference, and a second explicit approved rollback request before changing settings back.
- Rollback success is recorded only when Cloudflare confirms the restored value.
- Use `getOptimizationHistory` in chat to see suggested and approved Cloudflare actions.
- After an approved safe action changes infrastructure, run or wait for verification to check the result.

### Safety constraints

- Cloudflare write actions are unavailable unless safe actions are enabled for the account.
- Public docs, public chat, and unauthenticated agents cannot apply or roll back Cloudflare settings.
- Every apply or rollback should include scope, approval, rollback or forward plan, Cloudflare confirmation, and verification.


## Related docs

- [Quick start](https://heynimo.com/docs) - Start the workflow: find the gap, explain why, fix or hand off, and watch the result.
- [Set up a site](https://heynimo.com/docs/setup) - Add your site, choose important pages, pick a schedule, and understand what nimo checks.
- [Telegram](https://heynimo.com/docs/telegram) - Connect Telegram and use nimo from chat.
- [MCP for agents](https://heynimo.com/docs/mcp) - Use public docs MCP, or connect an authenticated MCP client to nimo.
- [Audits](https://heynimo.com/docs/audits) - Find the gap with CrUX field data, Lighthouse lab checks, history, and plain-language results.
