2

I am using pressflow having varnish + boost + memcache and also using cloudflare caching, I have seen some variable forms of settings.php file on forums and I am confused whether mine is optimal for best usage of all these caching mechanism :

# Varnish reverse proxy on localhost
$conf['reverse_proxy'] = TRUE;           
$conf['reverse_proxy_addresses'] = array('127.0.0.1'); 

# Memcached configuration
$conf['cache_inc'] = './sites/all/modules/memcache/memcache.inc';
$conf['memcache_servers'] = array(
         '127.0.0.1:11211' => 'default',
         );
### END Mercury settings written on 2011-11-01T07:12:49-04:00

2 Answers 2

3

Unless you are doing something quite unique, using boost & varnish is usually overkill. If you have varnish setup exactly how you want it, I would just use varnish.

Here is an example settings.php. It is a multisite safe memcache configuration thanks to the memcache_key_prefix setting.

<?php
// Skip db query that checks for blocked IP's.
$conf['blocked_ips'] = array();

// Reverse proxy settings.
$conf['reverse_proxy'] = TRUE;
$conf['reverse_proxy_addresses'] = array(
  '127.0.0.1',    // Localhost
);

// Use memcache for caches, locks, and sessions.
$conf['cache_inc'] = './sites/all/modules/memcache/memcache.inc';
$conf['lock_inc'] = './sites/all/modules/memcache/memcache-lock.inc';
$conf['session_inc'] = './sites/all/modules/memcache/memcache-session.inc';

// Memcache Settings.
// Set memcache server.
$conf['memcache_servers'] = array(
  '127.0.0.1:11211' => 'default',
);
// Set memcache bins.
$conf['memcache_bins'] = array(
  'cache' => 'default',
  'cache_form' => 'database',
);
// Set memcache prefix to be the location of the settings.php file.
$conf['memcache_key_prefix'] = basename(realpath(conf_path()));
// Try to use a persistent connection.
$conf['memcache_persistent'] = TRUE;
?>
3
  • Absolutely agree. Having both boost and varnish is pointless.
    – Mike
    Oct 30, 2012 at 21:48
  • 1
    I like the blocked IPs trick.
    – mpdonadio
    Nov 2, 2012 at 22:34
  • If only I could upvote this configuration more than once! :) Oct 22, 2014 at 23:35
0

Earlier it was believed that Boost+Varnish do work good if configured correctly - Is it redundant to use the "boost" module if varnish is used?, has this changed by recent developments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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