Hi to all
I need to built a website with drupal 7. For performance i planned to use varnish along with authcache. Is it right way? please suggest me and also help me how to install both authcache and varnish in drupal7.
FYI: In setting.php i made the following changes
(is it right ?)
$conf['cache_backends'][] = 'sites/all/modules/varnish/varnish.cache.inc';
$conf['cache_backends'][] = 'sites/all/modules/authcache/authcache.inc';
$conf['cache_class_cache_page'] = 'VarnishCache';
$conf['page_cache_invoke_hooks'] = FALSE;
$conf['reverse_proxy'] = true;
$conf['cache'] = 1;
$conf['cache_lifetime'] = 60;
$conf['page_cache_maximum_age'] = 21600;
$conf['reverse_proxy_header'] = 'HTTP_X_FORWARDED_FOR';
$conf['reverse_proxy_addresses'] = array('127.0.0.1');
$conf['proxy_port'] = 80;
$conf['omit_vary_cookie'] = true
Comments
Comment #1
znerol CreditAttribution: znerol commentedPlease read the following blog post to get an idea of what is required:
http://joshwaihi.com/content/authenticated-page-caching-varnish-drupal
Built-in support for varnish will arrive when the 2.x branch gets stable, but that will still take some weeks.
Comment #2
tssarun CreditAttribution: tssarun commentedThank you znerol so much for the response.
We will look forward to the update.
Meanwhile, in our case, 90% of the site/ pages are open for all.
A few blocks (eg. Poll, UserMenu, Search) and some pages as a whole (eg. ./user/*, ./contest/) are user specific.
User specific caching of these elements is not a requirement, since these can be directly fetched from the backend.
For now we are planning to use ESI for the user specific sections.
Since drupal sets cache-control to no-cache for authenticated users, even the common public regions arent getting cached in varnish. So similar to http://stackoverflow.com/questions/9009966/how-to-set-varnish-cache-cont..., we have placed a patch on VCL to set req.http.Cache-Control = "public, max-age=180"; set req.http.Vary = "Accept-Encoding,Cookie,User-Agent";
Comment #3
simg CreditAttribution: simg commented