Fixing “Error 503 Backend Fetch Failed” in Shopware 6.6 with Varnish: Header Too Long Explained
After upgrading from Shopware 6.5 to 6.6 and using Varnish as your reverse proxy, you may run into a sudden critical issue:
- Pages return 503 errors
- Varnish logs show messages like:
Varnish logs fill up withBogoHeader Header too long: xkey: ...
andFetchError http format error
.
This error is not widely documented, but it directly affects stores with advanced caching setups. Here’s what’s happening and how to fix it.
What’s Causing the Error?
Shopware 6.6 introduces more granular HTTP cache tagging via the xkey header. This allows precise cache invalidation by tagging each response with multiple cache keys.
However:
- The xkey header can grow very large (especially on pages with many entities).
- Varnish has strict defaults:
- Max size for a single header: 8KB
- Max size for all headers combined: 32KB
Once the xkey exceeds these limits, Varnish fails to process the response and returns a 503.
How to Identify the Issue
Varnishlog will show:
1 2 3 4 5 | BogoHeader Header too long: xkey: theme.sw-logo-... HttpGarbage "HTTP/1.1%00" FetchError http format error RespStatus 503 RespReason Backend fetch failed |
Your site’s users see:
Error 503 Backend fetch failed
Why It Happens After Upgrading to Shopware 6.6
- Shopware 6.6 enables more detailed cache tags by default.
- Each product/category/page adds to the growing xkey header.
- If you’re using use_varnish_xkey: true, the tag list expands even faster.
- The new config key for reverse proxy is:
shopware.http_cache.reverse_proxy (was storefront.reverse_proxy in 6.5)
Solution: Increase Varnish’s Header Limits
To support the larger headers, you need to manually increase Varnish’s limits.
Step 1: Edit the ExecStart Command in varnish.service
Find your varnish.service file (e.g., /etc/systemd/system/varnish.service) and update ExecStart like this:
1 2 3 4 5 6 | ExecStart=/usr/local/sbin/varnishd \ -a :6081 \ -f /etc/default/varnish.vcl \ -s malloc,512m \ -p http_resp_hdr_len=262144 \ -p http_resp_size=262144 |
These values raise the limits to 256KB (from the default 8KB and 32KB).
Step 2: Reload and Restart Varnish
Don’t forget:
- Both must be increased, one for any single header, one for all headers in total.
- Edit your unit file, then:
1 2 | sudo systemctl daemon-reload sudo systemctl restart varnish |
Confirm the Fix
Use these commands to check the active settings:
1 2 | varnishadm param.show http_resp_hdr_len varnishadm param.show http_resp_size |
Make sure both show the updated values.
Key Takeaways
- This is not a bug but a result of Shopware 6.6’s improved caching system.
- Varnish’s default limits are too low for the new cache tagging behavior.
- Without increasing these limits, your reverse proxy setup will break, even if your configs are otherwise correct.
- As your store grows or adds more plugins, you may need to tune these limits again.
- Plugins or themes that add additional cache tags or metadata can also contribute to this issue by increasing header size.
Need Help?
If you’re facing cache or proxy issues after a Shopware upgrade, 2Hats Logic Solutions can help. Our experienced Shopware developers specialize in performance tuning and Varnish configuration.
Recent help desk articles

Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
