blog-banner

Important Things to Setup Authcache in Drupal

  • AuthCache
  • Cache
  • Drupal Planet

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, and 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 set up auth cache 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 set up 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 systems like Memcached and Varnish. The backend system is used to store the cached files. Just install Memcached, and Varnish in your server/system.

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

After successfully installing 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 one of the sub-module of authcache module, it would help to indicate whether 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, that we should identify the dynamic user-based blocks, views, and 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, and 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 a username in any place on the site then you must replace the username with the following span tag, before that you must enable Authcache user cookie module.

Or

$username

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 delivered 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 kinds of pages. We can configure that from the path (admin/config/system/authcache/pagecaching) .

Get awesome tech content in your inbox