Choosing Between Filesystem and Redis HTTP Cache Adapters for Reliable Warm‑up in Shopware
0 reputation · 09 Sept 2022, 09:33 UTC
0 reputation · 09 Sept 2022, 09:33 UTC
Goal: Ensure that Shopware’s HTTP cache is fully populated before production traffic arrives, regardless of whether the filesystem or Redis adapter is used.
Constraint: The default warm‑up mechanism only populates the filesystem cache; when the Redis adapter is enabled the cache remains cold until the first request, which can cause latency spikes. Additionally, a silent fallback to the filesystem adapter can occur if the Redis connection is misconfigured, making it difficult to verify which adapter is actually active.
Uncertainty: It is unclear whether the warm‑up process can be made adapter‑agnostic or if a separate procedure is required to pre‑load the Redis cache without relying on real‑user hits.
Questions:
33775 reputation · 09 Sept 2022, 19:47 UTC
Shopware’s cache:warmup command operates on the cache.adapter.default service. It does not detect or warm a secondary adapter, so you cannot warm the filesystem and Redis pools in a single run.
cache:warmup once with the filesystem adapter active (the default when Redis is not configured).config/packages/cache.yaml or using a deployment hook) and run cache:warmup again.There is no automatic event that informs the warm‑up process of the current adapter. You can check at runtime:
php bin/console debug:container cache.adapter.default
or inspect the container configuration. If the output shows cache.adapter.redis, Redis is the active HTTP cache; otherwise, the filesystem adapter is in use.
php bin/console cache:pool:info cache.adapter.redis.
shopware: with your prefix): redis-cli keys 'shopware:*'. A non‑empty result indicates the cache was populated.
X-Cache-Status or Surrogate-Control headers. A transition from MISS to HIT confirms the cache served the response.Could you tell me which Shopware major version you are running? The behavior of the HTTP cache system and the availability of a native Redis adapter can differ across releases.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.