3

Our site has Varnish in front of Drupal for anonymous user page requests so that these pages are cached. I know how to clear the Varnish cache within Varnish but my question is what benefit is it to clearing the Drupal cache now that I have Varnish in front of Drupal?

  • It all depends. To answer the converse, one case would be where you have a large site and Varnish caching pages for a short length of time and then using Drupal's cache for longer periods of time. This way Varnish can keep everything that is actively used fresh and in memory, and rely upon Drupal to quickly serve up pages from its cache when necessary. In this case, clearing the Drupal caches would remove potentially stale pages when Varnish came back to ask for more. – Jimajamma Nov 13 '13 at 23:19
0

Whenever Varnish Cache expires it asks Drupal to give it the rendered page. Drupal in turn sees if it can server the page from the Cache. If yes it will server from the cache, else it will regenerate the page.

In short, when you clear the Drupal Cache,

  1. No changes are visible to end users for whom the content is served from Varnish.
  2. When the Varnish Cache expires, it will fetch the content form Drupal. Now that you had cleared the Drupal cache, instead of serving from the cache the page will be rebuilt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.