---
title: "Varnish cache HITS and Drupal cache MISS"
date: "2022-02-11T18:44:03+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/92591-varnish-cache-hits-and-drupal-cache-miss"
id: "ec92f67d-0007-4f26-93c1-63ae3e2547ae"
---

Table of contents will be added

Issue
-----

When you're using Varnish caching in Drupal 7 and 8, you might see headers on an HTTP request that mentions a Varnish `HIT` and a Drupal cache `MI`SS. This result isn't abnormal. Here's how it happens:

*   Varnish receives a request. It's a `MISS`, so it's passed through to Drupal.
*   Drupal receives the request. It's also a `MISS`.
*   Drupal caches the page and sends it back to Varnish with a response header indicating that it was a `MISS`.
*   Varnish caches the `MISS` response, which includes the `X-Drupal-Cache: MISS` response header.

When the page is requested again, it will be a cache `HIT` for Varnish, but it will contain the now cached response from Drupal, which has the `X-Drupal-Cache: MISS` response header. Every time a request for that page returns a Varnish `HIT`, it terminates without hitting Drupal. Because of this, the `X-Drupal-Cache` header is not necessarily providing up-to-date information, because it was cached in the past and will remain there until the cache's TTL (Time to Live) (`max-age`) has passed.

This pattern of `MISS` and `HIT` will occur when Varnish and Drupal are set up in the following two ways:

*   If the minimum cache lifetime ≤ expiration of cached pages, this will always happen.
*   If the minimum cache lifetime > expiration of cached pages, this will sometimes happen.

Resolution
----------

Acquia recommends large values for the expiration of cached pages, because Varnish obeys this value. Large values mean that most of the anonymous traffic will terminate in Varnish.

Additional resources
--------------------

*   How to purge cached pages in Varnish: [Purging Varnish cache on Acquia Cloud](/node/93536)
*   How to set up the Acquia Purge module to set up smarter, partial Varnish clears to cut down on stale content: [Installing Acquia Purge](/node/94206)
*   How to examine the values of the Varnish cache headers for your website page: [Varnish headers for Acquia Cloud](/node/56439)