Closed (fixed)
Project:
Varnish
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Jul 2011 at 20:21 UTC
Updated:
4 Aug 2011 at 12:51 UTC
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
Comment #1
fabsor commentedYou need to add all cache backends that you are going to use in the $conf['cache_backends'] array.
try changing:
to:
and the varnish cache config should be:
Comment #2
waverate commentedfabsor,
Thank you. That worked perfectly.
Comment #3
fabsor commentedAlright, setting to fixed!
Comment #4
paranormals commentedThank you. This worked for our setup with APC, Memcache and Varnish also.