Skip to main content
Setup Authcache in Drupal

Important Things to Setup Authcache in Drupal

We need some kind of Caching system to deliver quickly the pages, it will help to improve the site performance and usability. Drupal has a default built-in cache system but it is not enough for some of the complex sites, So we are choosing some kind of complex caching systems like Authcache, Memcached, Varnish. Authcache works with both Memcached and Varnish, we can use them as a backend of the caching process.


There are lots of tutorials available online on how to setup authcache in drupal, find some important links below,

  1. Authcache Big Picture
  2. Authcache tuning guide - Avoid databases
  3. Authcache upgrade to Varnish and ESI

You can setup the complete caching system for authenticated users from the above-mentioned links. So, I am going to share with you some of the important things in the authcache system,

1. Setup a Backend Caching system:

Before starting the authcache configuration best to configure backend caching system like Memcached, Varnish. The backend system is used to store the cached files. Just install Memcached, Varnish in your server/system.

  1. How to install Memcached?
  2. How to install Varnish?

After successfully installed the memcached, varnish doesn’t forget to enable the authcache backend storage builtin and authcache backend varnish on your drupal site. It will provide the integration between both systems.

2. Authcache Debug:

Authcache Debug is a one of the sub-module of authcache module, it would help to indicate the authcache is working or not and also it shows the debugging log message, it will help to identify the issues and fix that. Just enable the authcache module and assign developer/admin role to see the debug message on this page (admin/config/system/authcache/debug).

3. Identify the dynamic blocks, views, menus:

Another important thing is, we should identify the dynamic user based blocks, views, menus on your site. Authcache provides authcache ajax module, it would prevent showing the same content for all users. It will deliver the authcache ajax enabled block, views, menus content by the ajax request.

Just enable it like as below images for your blocks, views, and menus.


4. Replace username with Token:

If you are showing username in any places of the site then you must replace the username by the following span tag, before that you must enable Authcache user cookie module.

<span class="authcache-user"></span>


<span class="authcache-user">$username</span>

The authcache ajax module will overwrite the username with the current username, if you do not do the step, the first cached username will be delivering to all the users. So this is a must configuration in authcache setup.

5. Exclude more dynamic Pages:

Authcache is not suitable for most user-based content pages, so best to identify and exclude such kind of pages. We can configure that from the path (admin/config/system/authcache/pagecaching) .