Cloudflare offers several site acceleration tools that work at the CDN level without any server-side changes. Many of them can be enabled with a single click.
Auto Minify
Speed → Optimization → Content Optimization → Auto Minify.
Enable for: ✅ JavaScript, ✅ CSS, ✅ HTML.
Rocket Loader
Speed → Optimization → Content Optimization → Rocket Loader → On.
Defers JS loading until the HTML has fully loaded. Improves LCP and TTI (Time to Interactive).
Brotli Compression
Speed → Optimization → Content Optimization → Brotli → On. Brotli compresses text content 15–25% better than gzip.
HTTP/2 and HTTP/3
Network → HTTP/2 → On (enabled by default). HTTP/3 (QUIC) → enable for even higher speed on unstable connections.
Polish (Image Optimization)
Speed → Optimization → Image Optimization → Polish → Lossless or Lossy (Pro+).
| Mode | Description |
|---|---|
| Off | No optimization |
| Lossless | Removes metadata without quality loss |
| Lossy | Compression with quality loss (more aggressive) |
Early Hints (103)
Speed → Optimization → Performance → Early Hints → On. The browser starts loading resources before receiving the full HTML response.
Troubleshooting after turning on optimizations
The layout breaks or JS stops working after Auto Minify
HTML minification sometimes strips whitespace that actually matters (for example, between inline elements with layout that depends on it), and JS minification can break code that relies on non-standard ASI (automatic semicolon insertion) behavior or template strings with unusual formatting. Turn minification off one file type at a time (HTML first, then JS) to find the culprit, instead of disabling everything at once.
Rocket Loader breaks form or widget interactivity
Rocket Loader delays script execution and changes the order scripts run in, so code that expects a library to load synchronously (for example, an inline script calling jQuery right away) can run before the library has loaded. The fix is to add a data-cfasync="false" attribute to the specific <script> tags that should not be touched by Rocket Loader.
Verifying the effect of optimizations
# Check that Brotli is actually being applied
curl -I -H "Accept-Encoding: br" https://example.com/ | grep -i content-encoding
# Expected: content-encoding: br
# Check that the response is served from Cloudflare's cache
curl -I https://example.com/wp-content/themes/style.css | grep -i cf-cache-status
# Expected: cf-cache-status: HIT
The best way to see the real difference in load time is PageSpeed Insights or WebPageTest, run before and after enabling each setting — that shows which option actually helped and which did not. Finer control over caching specific paths is done through Cache Rules.
When Cloudflare's optimizations will not help
- The bottleneck is slow database queries or heavy server-side rendering: minification and Brotli speed up delivering a finished response, not generating it.
- The site already ships fully optimized, compressed, and minified files from a build tool (Webpack, Vite) — Cloudflare will not add a noticeable gain on top of an already finished build.
- The content is personalized per user (account dashboards, a shopping cart) — such pages are usually not cached, so part of Cloudflare's speedups do not apply to them. For multi-tier caching across data centers, see the article on Argo and Tiered Cache.
Before turning anything on, find the actual bottleneck using the Network tab in DevTools or a WebPageTest waterfall: if the slowest resource by far is the HTML document itself (TTFB), the problem is on the server, and no amount of static-asset minification will fix it.
Polish also converts images to WebP or AVIF for browsers that support them, based on the Accept header — the conversion happens automatically, without replacing the original files on the server.
When checking cf-cache-status from different locations, remember that Cloudflare runs dozens of data centers, and the first request to any given one always returns MISS, even if the same file is already cached in another city. Several requests in a row from one location are a more reliable check than one-off checks from different services.
For projects with an audience spread across several continents, Argo Smart Routing further cuts TTFB by routing requests along the fastest path between Cloudflare's data centers — it is a separate paid add-on on top of the regular CDN.