An OpenCart product card can change when the shopper switches currency, language or customer group. If a rendered card is cached solely by product ID, the next request may reuse a price, text or link from another context. Start by writing down what your cache stores: a raw lookup result, calculated data or complete HTML.
Practical check. Warm the cache as one customer group, then check the same product as a different group before and after a pricing change.
Key each value by its actual dependencies
A product title may require product, store and language identifiers. A formatted price can depend on currency, customer group, tax context and pricing rules. Include each dimension that changes the stored value. If rate conversion happens after reading a neutral cached amount, the currency may belong to the formatting layer instead. Keep personal identifiers and session values out of shared fragments.
| Check | What it shows | Where to verify |
|---|---|---|
| Store | Availability, URLs or configuration | Compare the same route on two domains |
| Language | Translated text and labels | Warm in one language, then request the other |
| Currency | Converted or formatted amounts | Switch currency with a warm cache |
| Customer group | Group-specific price or visibility | Compare guest and member scenarios |
Invalidate and test the shared cache
Normalize dimensions before creating a key. Equivalent filters in different orders should produce the same key when they produce the same result. Include a schema version when the stored representation changes. A short time to live limits the age of an entry. Use targeted invalidation when a price or availability change needs to appear immediately.
Warm the cache with one test context, then open the same item from a second context. Change only one dimension at a time. Repeat after a price, catalogue or language update. Record hit and miss counts and check which entries were invalidated. Separate personalized checkout or cart content from the shared part of the page.
Frequently asked questions
Should every key include currency?
Include it when the cached value changes with currency. A neutral lookup used before conversion can be shared if its other dependencies are covered.
Can a short TTL prevent cross-group prices?
Both groups can still receive the same wrong entry during that interval. Correct the input dimensions first.
Where do I put cart data?
Render individualized cart content separately and keep it out of the shared fragment cache.







