Magento full page cache: what punches holes in it
How Magento’s two cache layers decide whether a page is stored, returned, skipped or invalidated—and how to measure the result.
The cache model in two layers
Magento full page cache is not one switch. A Magento installation can have an application-level full page cache, while a reverse proxy such as Varnish can sit in front of the application and cache complete HTTP responses. They operate at different boundaries and can produce different results for the same request.
The Magento cache works with rendered page output. It avoids rebuilding the response from catalogue data, layout XML, templates and blocks when an eligible copy is already available. Varnish works with HTTP objects: request method, URL, host and whatever additional headers or cookies its VCL configuration uses to select a cache entry.
With Varnish in front of Magento, a request normally meets Varnish first. A Varnish hit never reaches PHP or the Magento application. A Varnish miss passes to Magento, where the application-level cache may then produce a hit. If that also misses, Magento renders the page and may store the result in the applicable cache.
This distinction matters when reading logs. A low Varnish hit rate does not prove that Magento is rendering every request, because Magento may still be serving a response from its own full page cache. The reverse is also true: a Magento cache hit observed behind Varnish may represent a Varnish miss that was successfully filled from Magento.
Hit, miss and bypass are not the same thing
| Outcome | What happened | What to examine |
|---|---|---|
| Hit | A stored response was returned without rebuilding the page. | The cache key, variant or cookie rules that selected it. |
| Miss | No usable stored response existed, so the request continued to Magento and the page was generated. | Why the entry was absent, expired or invalidated. |
| Bypass | The request was deliberately sent to the origin rather than considered for cache storage or lookup. | The VCL condition or application response that forced the bypass. |
A miss can be normal. A new page, a recently invalidated product URL or the first request after a cache clean will be a miss. Repeated misses on the same stable URL indicate a cache that is not retaining entries, generating too many variants, or marking responses as uncacheable.
A bypass is different from a miss. The request was not answered from the cache in the first place. It may still produce a fast response if Magento’s application cache can serve it, but the outer cache is providing no acceleration for that request.
Do not collapse bypasses into misses when calculating a hit rate. Report them separately. Combining them can make a cache look busy while hiding a rule that sends a whole class of traffic directly to Magento.
What punches holes in the cache
Private and customer-specific content
Shared cache entries are suitable only when the response can safely be reused for the next visitor. Logged-in areas, customer dashboards and account pages are obvious examples. Cart and checkout responses can also contain customer-specific prices, messages, totals or availability.
The safe approach is to keep shared and personalised output separated. Cache the common page shell or catalogue content, then obtain the changing part through a mechanism intended for private content. A response that embeds one visitor’s details is not safely shared merely because the rest of the page is cacheable.
Check cookies as well as application state. Varnish keys can be influenced by cookies even when the visible HTML appears identical. A rule that passes every request carrying a particular cookie may remove logged-in users from cache entirely, while a rule that ignores cookies when it should not can expose the wrong response.
Blocks marked uncacheable
An uncacheable block can make the entire page uncacheable. The page may contain a small dynamic element, but Magento cannot safely store that complete response for reuse if the element changes between requests. The surrounding catalogue page then becomes uncacheable too.
This is a frequent cause of cache rules that look reasonable at page level but fail in practice. The important detail is not merely whether a block uses dynamic data; it is whether that block is marked as producing output that cannot be shared. Review custom blocks, widgets and layout instructions rather than assuming a theme’s static header or footer is the cause.
Fixing the block may involve making its content genuinely shareable, moving it into a private-content mechanism or excluding the containing page from shared caching. Do not merely remove an uncacheable marker. That converts a correctness problem into a cache problem, where one customer can receive another customer’s output.
Customer group and cart state
Content that varies by customer group must either produce distinct cache variants or remain outside the shared response. Wholesale pricing, group-specific catalogue permissions and different promotional treatments all affect this decision. The implementation should preserve the correct variant and prevent a general customer from receiving a restricted response.
Cart state creates another boundary. A cart cookie, mini-cart summary, shipping estimate or promotional message can make an otherwise identical URL unsuitable for shared caching. Different cart identifiers also produce large numbers of possible request states if they are allowed into the cache key.
Passing every cart request to the origin protects correctness but lowers the useful hit rate. Treating every cart request as identical protects the hit rate but breaks the cache. The test is whether two requests with the same selected cache key must receive the same response. If not, they need separate handling.
Too many cache variants
Query parameters, tracking parameters, cookies, hostnames and store views can all fragment the cache. Each accepted variant consumes storage and reduces the chance that a requested page is already present. This often appears as a healthy-looking cache with a disappointing hit rate.
Canonicalise URLs where possible and decide deliberately which parameters affect the response. Parameters used only for attribution should not create different stored pages. Parameters that change price, content or permissions must not be normalised away.
Also check the relationship between Magento’s cache and the proxy’s URL handling. A proxy may treat trailing slashes, case or query ordering differently from Magento. The request should resolve to one intentional cache identity rather than several accidental ones.
What invalidates cached pages
Cache invalidation is the link between a content change and a stale response. Magento identifies affected cache entries when content is saved, while the proxy may also maintain its own stored response and expiry rules. The two layers must be considered together when a change is not appearing as expected.
Saving catalogue content
A product save invalidates relevant cached material associated with that product. The affected product URL is the obvious case, but related block cache entries may also be invalidated. Where a catalogue listing uses those blocks, the containing page may need to be refreshed rather than left with its previous rendered output.
The scope depends on what the page contains. Do not assume that every catalogue save invalidates every page, and do not assume that changing one field leaves all derived pages intact. Custom blocks, widgets and URL rewrites can widen the affected set. The practical check is to save the content in a controlled environment and observe which URLs are purged or refreshed at both cache layers.
Reindexing
Reindexing updates the indexes Magento uses to find and organise data. It is not a synonym for invalidating full page cache. A reindex can leave an existing cached HTML response intact because that response was already rendered, while the underlying indexed data has changed.
Some indexers relate to data used during rendering, so the operational result can depend on the indexer, the affected content and Magento’s invalidation behaviour. Treat reindexing and cache invalidation as separate operations. After substantial catalogue or configuration changes, verify the affected pages rather than relying on the reindex job to refresh all rendered output.
Continuous editing versus overnight imports
A store that saves products throughout the day repeatedly removes fresh entries and asks the next visitor to generate them again. An import concentrated into an overnight window may still invalidate the same affected URLs, but it leaves more time for the cache to refill before peak traffic.
The hit rate therefore reflects the rhythm of content change as well as cache configuration. A low rate on frequently edited pages is not automatically a proxy fault. Staggering imports, batching changes where the business permits it and checking whether frequently changed blocks prevent storage can all improve the useful hit rate without weakening cache correctness.
Measure the hit rate properly
A hit rate needs a defined population and period. Varnish counters, application cache logs and sampled HTTP headers answer different questions. Start with the proxy’s traffic because it sees the outer cache first, but keep bypasses and misses as separate categories.
- Use Varnish counters and logs. The cache hit and miss counters provide the broad result. Request logs can show the VCL return and the selected key or hash for individual requests. Check what was excluded before calculating a ratio.
- Sample Magento’s application cache. Where Magento’s full page cache debug output is enabled, its response header can show whether Magento itself served the request from cache. Use this to explain Varnish misses rather than treating them automatically as application misses.
- Segment by route. Measure product, category, CMS, search, cart and checkout traffic separately. A single combined percentage can conceal a healthy catalogue and a permanently bypassed search route.
- Exclude or classify non-content traffic. Monitoring checks, bots, preview requests, login flows and requests with unusual cookies can distort the result. They may need separate reporting rather than deletion from the data.
Measure over a representative period and after understanding whether counters were reset. A short test immediately after clearing the cache mostly measures cache warming. A long period that includes an import measures the operational pattern, but the counters must still be broken down enough to show which requests caused the misses.
Hit rate is not the same as store performance. A high rate can coexist with poor performance if the cached responses are small, slow to generate when missed or repeatedly bypassed. Pair cache measurements with request timing, origin load and route-level error monitoring.
The supported cache backend has changed
For Magento Open Source and Adobe Commerce 2.4.9, Adobe lists Valkey 9 for cache and sessions. Redis is not included in the supported combinations for that release. This is a plain platform change, not a difference between the open-source and licensed editions.
A store carrying an old Redis configuration through an upgrade therefore needs to address the backend explicitly. The configuration should be reviewed against the supported environment and migrated to Valkey where required, including the services and settings Magento expects for cache and sessions. Continuing to assume Redis is the supported option after the upgrade risks an unsupported stack that is difficult to distinguish from a cache-design problem when diagnosing performance.
Diagnose from the outside in
Start with the request path. Establish whether Varnish is returning a hit, missing and consulting Magento, or bypassing the cache. Then establish whether Magento’s application cache handled the request that reached it. Only after those two questions are answered should the investigation move to uncacheable blocks, customer state, URL variation or invalidation.
This order prevents the common mistake of tuning Magento block caching when the real problem is a proxy rule, or blaming catalogue imports when the affected route is never cacheable in the first place. The useful hit rate is the one that survives a check for correct content, not the largest number that can be produced by counting every request alike.
Questions this page answers
- What is the difference between a cache hit, miss and bypass?
- A hit returns a stored response, a miss continues to Magento because no usable stored response existed, and a bypass deliberately sends the request to the origin.
- How can private and customer-specific content affect Magento full page cache?
- Logged-in areas, customer dashboards, account pages, carts and checkout responses can contain customer-specific information. Shared and personalised output should be kept separate.
- What happens when a Magento block is marked as uncacheable?
- The entire containing page can become uncacheable, even when only a small dynamic element causes the problem. Fix the block, use private-content handling or exclude the page from shared caching.
- Does reindexing invalidate Magento full page cache?
- No. Reindexing is a separate operation from cache invalidation, and an existing cached HTML response can remain intact after the underlying indexed data changes.