I didn't want to hijack #1196916: Drupal 7.x and Varnish 3.x - Example default.vcl, so I created another issue.

I am running D7 with:

Each project page requires adding come caching statements to settings.php. Unfortunately, I am unable to get Memcache, APC and Varnish to play well with each other. If I uncomment #conf['cache_backends'] = array('sites/all/modules/varnish/varnish.cache.inc'); then the page goes into WSOD.

# Memcache
include_once('./includes/cache.inc');
include_once('./sites/all/modules/memcache/memcache.inc');
$conf['cache_default_class'] = 'MemCacheDrupal';

# APC
$conf['cache_backends'] = array('sites/all/modules/apc/drupal_apc_cache.inc');
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';

# Varnish
#$conf['cache_backends'] = array('sites/all/modules/varnish/varnish.cache.inc');
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['page_cache_invoke_hooks'] = false;
$conf['reverse_proxy'] = true;
$conf['cache'] = 1;
$conf['cache_lifetime'] = 0;
$conf['page_cache_maximum_age'] = 21600;
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';
$conf['reverse_proxy_addresses'] = array('127.0.0.1');
$conf['omit_vary_cookie'] = true;

Any suggestions?

Comments

fabsor’s picture

Status: Active » Needs review

You need to add all cache backends that you are going to use in the $conf['cache_backends'] array.

try changing:

$conf['cache_backends'] = array('sites/all/modules/apc/drupal_apc_cache.inc');

to:

$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';

and the varnish cache config should be:

$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
waverate’s picture

Status: Needs review » Reviewed & tested by the community

fabsor,

Thank you. That worked perfectly.

fabsor’s picture

Status: Reviewed & tested by the community » Fixed

Alright, setting to fixed!

paranormals’s picture

Thank you. This worked for our setup with APC, Memcache and Varnish also.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.