Codewerk.
Get a quote
Home/Blog/Clearing Shopware caches properly (and why it 'came back')

Clearing Shopware caches properly (and why it 'came back')

There is no single cache. There are five, and the one you forgot is the one still serving yesterday's price.

Photo: free stock photography (Unsplash licence) — see imprint

The five caches

The application cache (containers, config), the Twig/template cache, the HTTP cache, the reverse proxy in front of it (Varnish or a CDN), and PHP's own opcache. Clearing one and declaring victory is how a 'ghost' price survives a deploy.

Clearing everything is not free

A full cache clear on a busy shop means every next visitor rebuilds pages from the database at once. Do it at a quiet hour, or warm the cache afterwards — a cleared cache at 10 a.m. on Monday is a self-inflicted outage.

Invalidate, do not flush

Shopware invalidates cached pages when the underlying entity changes. If you find yourself flushing everything after every price update, something is wrong with your invalidation — fix that instead of scheduling a nightly flush.

Deploy scripts, not a wiki page

Cache handling belongs in the deployment script, in the right order, every time. A checklist that a human follows at midnight will eventually be followed at midnight by a tired human.

Key takeaways
  • Five caches — the forgotten one serves stale prices.
  • Never full-flush during business hours.
  • If you must flush often, your invalidation is broken.

We do this for a living — Shopware, Node.js, React, ERP integration and automation for B2B.

Talk to an engineer

// Keep reading

Related articles