Typical situation: a Bitrix site runs slowly at 50–100 RPS. The origin server becomes saturated because Nginx allocates resources to serve static assets. Consider a catalog of 50,000 products with photos of 2 MB each. Without CDN, each visitor loads images from your server, generating 200–300 RPS on static files — Nginx and PHP-fpm are idle, processing requests that could be served from a cheap edge. We solve this problem by connecting Cloudflare CDN. Static files are served from edge servers, while the origin handles only dynamic content. Server load drops by 40–70%, and page load performance increases. Hosting costs decrease by 40–70%. Cloudflare CDN reduces server load by up to 70%, which is 2–3 times better than typical caching solutions.
What to cache and what not
Cloudflare by default caches files by extension: .js, .css, .jpg, .png, .woff2, .svg and others. HTML and PHP are not cached. For Bitrix this is correct — dynamic pages must be generated on the server. We implement static caching Cloudflare to offload origin.
Exceptions are configured via Page Rules or Cache Rules:
| Path | Action | Reason |
|---|---|---|
/upload/resize_cache/ |
Cache | Image transformations do not change after generation |
/bitrix/cache/ |
Do not cache | Internal Bitrix cache, not intended for CDN |
/bitrix/admin/* |
Bypass | Admin panel should not be cached |
/personal/*, /auth/* |
Bypass | Personal account, authorization forms |
Reasons Cloudflare may not cache static files
Common issue: Cloudflare shows DYNAMIC for .js and .css. Reason: server sends Cache-Control: no-store or Set-Cookie. Bitrix may add a session cookie on any request. Solution: configure Nginx so that static files are handled directly, without passing to PHP. Add a separate location:
location ~* \.(js|css|jpg|jpeg|png|gif|ico|svg|woff|woff2|ttf|eot)$ { expires 30d; add_header Cache-Control "public, immutable"; } The immutable directive tells the browser that the file will not change — the browser will not send a conditional request (If-Modified-Since). For Bitrix this is correct because the bundler (Vite/webpack) adds a hash to the filename on each build.
Setting up Cloudflare CDN for Bitrix
- Add your domain to Cloudflare — change NS records to those provided by Cloudflare.
- Configure DNS — ensure A records point to your server, enable orange cloud for proxy.
- Configure Page Rules — for paths
/upload/*and/bitrix/images/*setCache Level: StandardandEdge Cache TTL: 1 month. For/bitrix/admin/*,/personal/*,/auth/*—Cache Level: Bypass. - Enable optimizations — in Dashboard: Speed → Optimization enable Polish (lossy) and Brotli. Auto Minify for JS and CSS (disable HTML).
- Verify caching — open developer console and check headers on a static file. Should have
cf-cache-status: HIT.
Comparison before and after CDN setup
| Parameter | Before CDN | After CDN |
|---|---|---|
| Server load | 100% RPS | 30–60% RPS (reduction up to 70%) |
| Page load time | 4.5 s (first view), 3 s (repeat) | 1.2 s (first view), 0.8 s (repeat) — 60% improvement |
| Traffic on origin | Full | Only dynamic (~30% of original) |
Minification and optimization
Cloudflare offers Auto Minify for JS, CSS, and HTML. For Bitrix, disable HTML minification — it may break inline <script> tags and inline styles. JS and CSS minification can be kept, but if you already minify at build stage (Vite, webpack), Cloudflare minify adds no benefit and only adds edge delay. Additionally, use Concatenation and Cache Key features for better cache hit ratio. Advanced concepts like origin shielding and edge cache invalidation further optimize performance.
Polish (image optimization) — enable. Compresses JPEG and PNG without quality loss (lossy/lossless). For catalogs with thousands of product photos, traffic savings reach 20–30%. In fact, Cloudflare CDN with Polish reduces image sizes by an additional 20–30% compared to no optimization. It also converts images to WebP automatically where supported, further reducing weight by 25%.
Brotli compression — enable. Cloudflare compresses text responses (HTML, JS, CSS) with Brotli algorithm, which is 15–20% more efficient than gzip. Our experience shows noticeable speedup for users with slow internet. More about Brotli.
Verifying CDN operation
After setup, check response headers for a static file:
-
cf-cache-status: HIT— file served from Cloudflare cache. -
cf-cache-status: MISS— file fetched from origin (first request or cache expired). -
cf-cache-status: DYNAMIC— Cloudflare does not cache this resource (HTML, PHP).
If you see DYNAMIC for .js or .css — check if origin sends Cache-Control: no-store or Set-Cookie. Cloudflare does not cache responses with Set-Cookie, and Bitrix may send session cookie on any request. Ensure that for static files, Nginx handles directly without passing to PHP.
What's included in the work
We provide a full scope of work with clear deliverables:
- Documentation: Detailed configuration report with all changes made (Nginx, Page Rules, DNS settings).
- Access: We ensure you have full access to Cloudflare dashboard and explain key settings.
- Training: A 1-hour online session for your team on how to manage CDN settings.
- Support: 30 days of post‑setup support for any issues or adjustments.
- Guarantee: If after our setup CDN works incorrectly, we fix it for free.
Our experience: over 5 years on the market, 200+ projects on Bitrix, certified specialists. Order a site audit — we will prepare a custom proposal.
Checklist for self-verification
- Checked Cache-Control for static files
- Disabled serving static files through PHP
- Configured Page Rules for /upload/ and /bitrix/
- Enabled Polish (lossy or lossless)
- Enabled Brotli
- Disabled HTML minification
- Checked cf-cache-status headers
Get an engineer consultation — we will assess your project within 1 day. As noted in Cloudflare documentation, proper caching configuration boosts performance manifold. Our Cloudflare CDN Bitrix expertise ensures maximum edge cache utilization.

