Title: (Open) questions in my Varnish context
Last modified: December 19, 2025

---

# (Open) questions in my Varnish context

 *  Resolved [cybeardjm](https://wordpress.org/support/users/didierjm/)
 * (@didierjm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/)
 * Hi,
 * After years of struggling with page caching, probably due to a lack of full technical
   curiosity on my side, I discovered yesterday that the Varnish cache installed
   on my host [Apache – 1.1 varnish (Varnish/6.3)] was not fully seen/viewed/used
   by my 2 WP [6.9] blogs.
 * After reading more about this subject, interacting with the host’s support team
   and tweaking my blogs some more, I discovered this plugin (as well as the “Cacheability”
   plugin) and it seems that requests to both blogs now go through the Varnish cache:
   when using “Check Caching” I can see values for X-cache-age, X-cache-hits and
   X-cache = HIT and the Median server response time is much better than it previously
   was (without any page and/or object cache plugin).
 * But,
   1 Proxy Cache Purge reports “**Cache Service**: No known cache service has
   been detected on your site.”This means, at least, that I won’t be able to purge
   remotely.But in “Check Caching” I get: “**Remote IP** Your server IP setup looks
   good.”2 and “The ‘Age’ header is returning 0, which means it is not properly 
   caching. Either this URL is intentionally excluded from caching, or a theme or
   plugin is instructing WordPress not to cache.”Also, the “Cache-control:” value
   is empty as I removed max-age and ExpiresDefault from .htaccess while I do these
   tests. [I get max-age=0 when I set values and I don’t understand why yet.]
 * PS: I tried the plugin alone in troubleshooting mode, and it’s the same.
 * For (1), I tried adding an IP or “localhost” and this didn’t change anything.
   What am I missing here? What should I look for?
 * For (2), AFAIK, and after looking on both blogs as they report the same error,
   I haven’t found or have any more clue where this value might be set. As said 
   above, I removed all page/object caching plugins.
 * Am looking for leads to investigate further…
   SincerelyDJM
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fopen-questions-in-my-varnish-context%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18763163)
 * **Re: Point 1 – “No known cache service detected” but X-Cache shows HIT**
   This
   is a false negative from our header-based detection. The detection uses _heuristics_
   that look for specific header patterns, and not all Varnish configurations expose
   the headers our detection expects.
 * The cache debug relying on headers heuristics can never cover 100% of setups 
   out there – some services simply will hide cache header, and then it is expected(
   and quite normal!) for debug cache page to assume you have no cache setup. 
   _The
   key fact:_ you’re seeing X-Cache: HIT – this confirms Varnish IS caching your
   content. The “no cache service detected” message is simply wrong in your case.
   We just released version 5.5.3 which includes a new End-to-End Cache Test (in
   Proxy Cache → Check Caching → first tab). This test doesn’t rely on header detection
   at all – it actually creates a test post, verifies caching works, triggers a 
   purge, and confirms purging works. Please update and run this test for a definitive
   answer.About purging: The plugin will _still_ send PURGE requests to your cache
   when content is updated. Whether they work depends on your Varnish configuration
   accepting them. The new E2E test will verify this for you.**Re: Point 2 – Also,
   the “Cache-control:” value is empty as I removed max-age and ExpiresDefault from.
   htaccess while I do these tests.**WordPress does not send `Cache-Control` for
   posts by default. It means that Varnish will cache with whichever is default 
   cache lifetime in your server environment.If you’re seeing `Cache-Control` coming
   from your WordPress, it may be two of these major things:* Bad plugins (ANY plugin
   not just cache, etc.) – those are typically that start PHP session with no reason
   whatsoever by performing `session_start()` in PHP code, the end result is negative
   cache control, and `Set-Cookie` being present in the response – this same like
   to say to Varnish “don’t cache me”* Good plugins would emit `Cache-Control` with
   a date in the future (so that Varnish knows to cache specific pages with a fine-
   grained cache lifetime).Only way to tell for sure, is to disable all the plugins
   and examine response headers from your website while enabling plugins one by 
   one.[https://github.com/dvershinin/varnish-http-purge/wiki/Troubleshooting](https://github.com/dvershinin/varnish-http-purge/wiki/Troubleshooting)
 *  Thread Starter [cybeardjm](https://wordpress.org/support/users/didierjm/)
 * (@didierjm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18763180)
 * Thx [@dvershinin](https://wordpress.org/support/users/dvershinin/) for your answers.
 * Indeed the latest version allowed the test to validate the varnish cash exists
   and works fine.
   So probably, the `X-Varnish` header is not sent by the host.The
   purge, that works via the test, doesn’t happen when applying the command “Purge
   Cache” from the menu. Have to switch to the host’s control panel. That’s fine.
 * Re:max-age I was able to fix via .htaccess and now have a proper generic value.
   I’ll tweak this some more.
   But I still have age=0 – I’ll test some more as X-
   cache-age evolves normally when checking on pages.
 * Thanks again.
   SincerelyDJM
 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18763191)
 * **About “Purge Cache” from the menu not working:**
 * This is curious since the E2E test uses the same purge mechanism. A few things
   to check:
    - Cache IP setting: Go to Proxy Cache → Settings and check if a Cache IP is 
      configured. If it’s empty, try setting it to 127.0.0.1 or localhost. Some 
      hosts require this to be explicitly set.
    - What the menu purges: The “Purge Cache” button in the admin bar sends a full-
      site regex purge (/.*), whereas the E2E test purges a specific URL. Your host’s
      Varnish might accept specific URL purges but block regex/wildcard purges for
      security.
    - Ask your host: Since you mentioned using their control panel works — your 
      host may have intentionally disabled regex PURGE requests (or simply never
      supported) or requires a specific kind of request for complete cache clear
      which is known only to them. You may want to ask: “I want to clear my whole
      Varnish cache using curl, what should I run on the command line?” – you can
      follow up here, and maybe there’s a new purge method to be born for a host-
      specific cache clear.
    - If specific-URL purges work (E2E test) but full-site purges don’t (menu), 
      that’s actually fine for normal operation — the plugin automatically purges
      relevant URLs when you edit content. The “Purge Cache” button is really only
      needed for emergency full-site clears.
 * **About Age=0:**
 * If X-Cache-Age shows proper values on actual pages but Age header is 0, your 
   host is likely stripping the standard Age header while keeping their custom X-
   Cache-Age header. This is just a cosmetic difference — your caching is working.
 * Glad the E2E test helped clarify things!
 *  Thread Starter [cybeardjm](https://wordpress.org/support/users/didierjm/)
 * (@didierjm)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18763196)
 * FYI, found this info at the end of the E2E test:
 * “It appears you are using softpurge or grace-based caching, which serves stale
   content briefly while fetching fresh content in the background.”
 * DJM
 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [3 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18763199)
 * soft purge is definitely a good thing!
 *  Thread Starter [cybeardjm](https://wordpress.org/support/users/didierjm/)
 * (@didierjm)
 * [2 months, 4 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18784365)
 * Hi,
 * Wrote a quick post (in French) on my blog about WordPress/Varnish:
 * [https://www.didiermary.fr/wordpress-cache-varnish/](https://www.didiermary.fr/wordpress-cache-varnish/)
 * Thx for your answers.
   DJM
 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [2 months, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18787031)
 * [@didierjm](https://wordpress.org/support/users/didierjm/) great write up! 
   Worth
   noting about .htaccess like the following: `ExpiresDefault "access plus 30 days"…
   might instruct _both_ browsers and Varnish to cache pages for 30 days, which 
   is often undesired (depends on actual setup).Plugins like Cacheability Pro solve
   this by allowing you to fine tune Cache-Control sent by WordPress to make use
   of s-maxage instruction which is what applies only to Varnish:Cache-Control: 
   max-age=60, s-maxage=86400In this example, page is cached for up to a minute *
   in browser*, while instructing Varnish to cache for a day. In fact, s-maxage 
   should be set even to months to make the Varnish cache highly efficient – cache
   never goes stale, because it is cleared automatically by Proxy Cache Purge.P.
   S. An alternative to s-maxage modifications via plugins is editing Varnish VCL
   configuration directly, but in shared hosting that is likely not available.
 *  Thread Starter [cybeardjm](https://wordpress.org/support/users/didierjm/)
 * (@didierjm)
 * [1 month, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18825227)
 * Hi again,
 * I had to remove the Cacheability plugin, after the last update: it was sending
   a max-age=0, added to mine (so had 2 in the header).
 * After deleting it, I rerun the full test, and now everything is green on my side(
   on 4 blogs in 3 different hosting servers in the same infrastructure).
 * ![](https://i0.wp.com/www.didiermary.fr/wp-content/uploads/2026/02/cache.jpg?
   ssl=1)
 * That was not the case before with the plugin active, where tests 1, 2 and 4 where
   not detected (orange).
 * So now it seems everything works better, including the purge when updating a 
   post…
 * THX
   DJM
 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [1 month, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18825403)
 * [@didierjm](https://wordpress.org/support/users/didierjm/) Thanks for the update!
 * Actually, `max-age=0` with `s-maxage` is the correct Varnish configuration pattern.
   Here’s what it means:
 * `Cache-Control: max-age=0, s-maxage=86400`
    - `max-age=0` → browsers always revalidate with the server (no browser caching)
    - `s-maxage=86400` → Varnish caches for 24 hours
 * This is actually optimal for WordPress because:
    1. Browsers always get fresh content from Varnish
    2. Varnish serves cached content at lightning speed
    3. When you edit a post, Proxy Cache Purge clears only Varnish — browsers automatically
       see the update on next request
 * The duplicate `max-age=0` in headers you mentioned is a separate issue — that
   would indeed be a bug that was now addressed in the recent Cacheability release.
   That said, it can’t possibly detect `max-age` you set in .htaccess – you either
   use a plugin to do it, or rely on .htaccess alone. The plugin way gives you flexibility
   that .htaccess doesn’t.
 * Good news: We just released Proxy Cache Purge 5.6.5 which now correctly recognizes`
   max-age=0` with `s-maxage > 0` as valid Varnish configuration. Previously, the
   cache detection would flag this as “not properly caching” — that false warning
   is now fixed.
 * Since you’re running 4 blogs across 3 servers, you might find [GetPageSpeed Amplify](https://amplify.getpagespeed.com/)
   useful — it’s a free monitoring dashboard that shows Varnish cache hit ratios,
   backend health, and object stats across all your servers in one place.
 * Glad everything is working for you!

Viewing 9 replies - 1 through 9 (of 9 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fopen-questions-in-my-varnish-context%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/varnish-http-purge/assets/icon-256x256.png?rev=3027185)
 * [Proxy Cache Purge](https://wordpress.org/plugins/varnish-http-purge/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/varnish-http-purge/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/varnish-http-purge/)
 * [Active Topics](https://wordpress.org/support/plugin/varnish-http-purge/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/varnish-http-purge/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/varnish-http-purge/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)
 * [caching](https://wordpress.org/support/topic-tag/caching/)

 * 9 replies
 * 2 participants
 * Last reply from: [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * Last activity: [1 month, 3 weeks ago](https://wordpress.org/support/topic/open-questions-in-my-varnish-context/#post-18825403)
 * Status: resolved