Skip to content

Instantly share code, notes, and snippets.

@szeidler
Created September 9, 2015 09:47
Show Gist options
  • Save szeidler/a2fdb111f5110e21f1eb to your computer and use it in GitHub Desktop.
Save szeidler/a2fdb111f5110e21f1eb to your computer and use it in GitHub Desktop.
Make drupal purge varnish cache after node changes
<?php
// Varnish
$conf['cache_backends'][] = 'sites/all/modules/contrib/varnish/varnish.cache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
// Drupal 7 does not cache pages when we invoke hooks during bootstrap. This needs
// to be disabled.
$conf['page_cache_invoke_hooks'] = FALSE;
$conf['reverse_proxy'] = TRUE;
$conf['cache'] = 1;
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';
$conf['omit_vary_cookie'] = FALSE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment