Cloudflare for Shopware

Cloudflare for Shopware: protection and speed without side effects

Shopware 6 is a dynamic system: basket, session, customer groups, prices, availability — much of it changes from visitor to visitor. Cloudflare is preset for static websites. Whoever simply plugs the two together gets foreign baskets from the cache, payments that are never confirmed, and an administration that no longer saves. We have operated Shopware shops for years and set up Cloudflare for them so that it protects and accelerates without getting in the shop’s way.

Make an enquiry 0441 21 21 63 0 Mo – Fr, 9:00 – 16:00 Uhr

Where Cloudflare in front of Shopware usually fails

The mistakes are always the same — and they are only noticed when a customer gets in touch.

Someone else’s basket

A cache rule that stores “everything” delivers personalised pages to the next visitor: basket, customer account, customer-specific prices. In a B2B shop that is a data protection incident, not a cosmetic flaw.

Payments are not confirmed

The payment provider reports the payment to the shop with a callback. The bot protection sees a machine without a browser and blocks it. The order stays “open”, the customer has paid, nobody knows why.

Interfaces run into a wall

ERP, PIM, price lists, marketplace connections: all machines that regularly call the shop’s API. Each of them can be hit by Bot Fight Mode or a firewall rule that is too broad.

The server is still open next door

The address of the shop server is still publicly known. Whoever knows it walks past Cloudflare — and the whole firewall is decoration.

What makes Shopware different from a website

A company website delivers the same page to every visitor. Shopware does not: as soon as a visitor puts something in the basket, logs in or belongs to a customer group with its own prices, the page is personal. Shopware marks this with cookies and works with its own HTTP cache that handles exactly this distinction. Cloudflare has to adopt it, not override it.

Then there are the machines: the administration with its API, the Store API for headless frontends and apps, the callbacks of the payment providers, the synchronisation with ERP and PIM. None of them has a browser, all of them look suspicious to blanket bot protection. A Cloudflare setup for Shopware is therefore first of all a list of exceptions that fit the shop — and only then a set of rules against attackers.

Cache rules that understand the shop

Static files — theme, scripts, media, product images — can be held by Cloudflare for a long time. This is where the biggest gain in load time and server load lies, especially during promotions. Page content is cached at the edge only while the visitor has no session; as soon as Shopware sets a session cookie, the request bypasses the cache and goes to the shop. Basket, checkout, customer account and administration are never cached.

Shopware’s own HTTP cache stays active — both layers have to fit together, otherwise they show different states. And we tie cache clearing to the shop: when a product is changed or a price updated, the old version disappears at the edge too, not only after it expires. Convenience features that rewrite or lazy-load scripts we switch off; they silently break storefront and administration.

Firewall and bot protection with the right exceptions

Only those who need the administration can reach it: by network, country or with a challenge in front. The API stays open for the interfaces you actually use, and for nobody else. The callback addresses of your payment providers are explicitly on the allow list, as are monitoring and ERP. Requests for files that do not exist in a Shopware shop — foreign admin paths, configuration backups — are dropped immediately.

For bot protection the plan decides: the simple Bot Fight Mode has no exceptions and is practically unusable for a shop with a payment provider. Super Bot Fight Mode allows verified bots and custom rules that exclude certain paths — so the scanner sees the challenge page and the payment provider does not. Rate limiting caps login attempts, search queries and account registrations per sender; Turnstile protects registration and contact form without picture puzzles.

Rules are never finished. After going live we read the security events and check whether anything was blocked that should have passed. False positives become exceptions, new patterns become rules.

Encryption, and a server that only Cloudflare can reach

The connection between Cloudflare and your server stays encrypted all the way — with a valid certificate on the server, not in the “flexible” mode that lets traffic behind Cloudflare run in plain text. The server itself accepts web requests only from Cloudflare’s networks; on request Cloudflare additionally identifies itself to the server with a certificate.

And so that Shopware still sees real visitors: logs, the shop’s own login throttle and statistics receive the original visitor address from the Cloudflare header instead of the address of the Cloudflare network. Without this detail every server-side throttle runs into nothing — and every visitor looks the same to the shop.

Operation and your account

The Cloudflare account belongs to you; we work as a member with the necessary rights. Every setting is documented and justified. Because attack patterns, your interfaces and Cloudflare’s features change, the zone is part of the regular review cycle of our Shopware maintenance.

For context: Cloudflare is a US provider, and your customers’ traffic passes through its network. Using it belongs in the shop’s privacy policy and requires a data processing agreement, which Cloudflare provides. We supply the technical details.

Process

Your shop behind Cloudflare — without side effects.

Send us the shop domain and, if available, a list of your interfaces and payment providers. You get an assessment of what makes sense in your situation — before the first click in Cloudflare.

  1. 01

    Inventory

    Which interfaces, payment providers and apps access the shop? Which paths, which senders? What is already configured in an existing zone?

  2. 02

    Foundation

    DNS, end-to-end encryption, server reachable only by Cloudflare, real visitor addresses in the shop.

  3. 03

    Cache

    Rules for static files and pages, bypass on session, interplay with the Shopware cache, clearing on changes.

  4. 04

    Firewall and bot protection

    Allow list for payment providers and interfaces, protection for administration and API, Bot Fight Mode matching the plan, rate limiting, Turnstile.

  5. 05

    Test run and follow-up

    Test order through every payment method, interface run, then read the security events and adjust the rules.

Projects on this system

Shopware 6 M&S Armaturen Shopware 6 B2B shop with connected item and pricing logic
Shopware · OCI Lijnco B2B shop with OCI punch-out into the customer systems

A selection — not the full client list.

Frequently asked questions

Does Cloudflare make our Shopware shop faster?

For static files, clearly: images, scripts and styles come from the Cloudflare edge near the visitor instead of from your server. For the pages themselves it depends on how many visitors browse without a session — product and category pages for anonymous visitors can be cached, personalised pages cannot. What Cloudflare does not replace is a fast shop behind it: a slow checkout stays slow.

Which Cloudflare plan makes sense for a shop?

In practice at least the Pro plan. The reason is bot protection: the free plan only has the simple Bot Fight Mode without exceptions — it hits payment providers and interfaces just like scanners. Only Super Bot Fight Mode allows verified bots and custom exceptions. Add to that the full managed firewall rulesets. Cloudflare changes the exact limits per plan from time to time; we check them during setup.

Why are payments no longer confirmed after the switch?

Almost always the bot protection or a firewall rule: the payment provider’s callback comes from a server without a browser and is treated as an automaton. The order stays “open” although it was paid. The solution is an allow list for the provider’s callback addresses and bot protection that knows exceptions — and a test run through every payment method before the shop is released again.

Can Cloudflare break the Shopware administration?

Yes, if convenience features are active that rewrite or lazy-load JavaScript, or if administration paths are cached. Symptom: the administration does not load, does not save or shows old states. We switch these features off, exclude administration and API from the cache and protect them through the firewall instead.

What about Shopware’s own HTTP cache?

It stays active and is the first layer; Cloudflare is the second. Both need the same logic: when is a page the same for everyone, when is it personal? And both have to be cleared on publishing, otherwise one layer shows the old state. We tie the clearing of the Cloudflare cache to events in the shop instead of waiting for expiry.

Do we need Cloudflare if you host our shop?

Not necessarily. Our servers in Germany are hardened and monitored. Cloudflare adds a line of defence in front of the server and intercepts mass traffic before it costs your resources — for shops with payment traffic, an international audience or frequent promotions we recommend it. For a small shop with a regional audience we discuss it openly.

Who owns the Cloudflare account?

You do. The zone runs in your account, we are invited as a member. Domains, certificates and rules stay with you even if our cooperation changes. An existing zone we take over as it is and clean up.

How long does the setup take?

For an existing shop the setup is manageable — we state the effort after looking at shop and zone, because it depends on the number of interfaces and payment providers. We schedule the switch itself outside your peak hours, with test orders through every payment method before the shop is released again.

Enquiry

Where do you stand with Cloudflare?

Whether nothing is set up yet or the shop already runs behind Cloudflare and causes problems: we look first, then we say what needs to be done.

  • An answer from someone who knows the system — no phone queue
  • An assessment before the quote, even when it advises against the project
  • Your details are sent to us by email, not into a third-party CRM

Spam protection: Cloudflare Turnstile — no cookies, no tracking.

Call Start a project