Authcache Flowchart

The Authcache module offers page caching for both anonymous users and logged-in authenticated users. This allows Drupal/PHP to only spend 1-2 milliseconds serving pages, greatly reducing server resources.

Please note that enabling authenticated user caching will require modifying how your user-customized content displays on your pages. You should be an experienced Drupal developer if you choose to implement the full functionality of this module.

Also note that this module will not help improving the performance of administrative forms like node edit. However it is useful for speeding up news or commerce sites with a significant portion of authenticated users.

How does it work?

Authcache saves the final rendered HTML of a page to serve visitors. A separate cache is created for each user role as defined by the administrator, so some roles can be excluded if necessary.

Authcache places priority on serving pages to the visitor as fast as possible. After a page is loaded by the browser, a second HTTP request may be performed via Ajax. This initiates a lightweight DRUPAL_BOOTSTRAP_SESSION that allows SQL queries to be executed (such as updating the user "history" table or node "statistics" table), and returns any user-customized data to the page (such as form tokens or default values on a contact form).

What type of caching is used?

Authcache on Drupal 7

Drupal database
By default, Authcache will use the cache_page table to store cached pages. To avoid hitting the database, download and install a cache handler module...
Contrib modules providing DrupalCacheInterface implementations
For example:
Varnish (new in 7.x-2.x)
Do not store rendered pages but set the correct HTTP headers such that pages generated by authcache can be served from Varnish reverse proxy server. Please see the example.vcl shipping with the Authcache Varnish module for more information.
Fastly and other reverse proxy / CDN services
The contrib backend Authcache Upstream is a simpler alternative to the Varnish module shipping with Authcache core. The Authcache Key is stored in a cookie which makes it much easier to integrate with CDN services and reverse proxies (including Varnish)
Boost (new in 7.x-2.x, Experimental support in authcache 7.x-2.x)
Using boost as authcache backend it is possible to let Apache serve rendered HTML pages without bootstraping drupal at all #2349495: Move Authcache Boost to its own project

The following core modules are supported out of the box:

Load blocks using Ajax or ESI
Handle new-flag and edit-link (for roles having "edit own comment" permission). Also retrieve the number of new comments on node-links via JavaScript
Field (new in 7.x-2.x)
Load core fields using Ajax or ESI. This is especially useful together with the Fivestar module.
Load form tokens and form build-ids (for Ajax enabled forms) via Ajax or ESI
Load the number of new topics on the forum overview page via Ajax or ESI
Load tabs and local actions using Ajax or ESI
Load poll form and/or results using Ajax or ESI
Populate the contact form with data loaded using Ajax or ESI

Additionally the following contrib modules are supported out of the box (7.x-2.x):

Load all flags on a page using only one Ajax or ESI request
Load panels content pane using Ajax or ESI - as long as they are displayed via Page Manager
Load views using Ajax or ESI

Authcache 7.x-2.x integrates with the Cache Expiration module. Also it features a modular architecture allowing easier integration with third-party modules and themes.

Authcache on Drupal 6

Drupal database
By default, Authcache will use the cache_page table to store cached pages. To avoid hitting the database, download and install a cache handler module...
Cache Router

This module supports APC, eAccellerator, XCache, Memcache, and the file system.

Memcache API
This module is similar to Cache Router, but functions differently and has features not found in Cache Router, such as caching the user sessions table.

Most other cache handler modules can be configured to work with Authcache as well.

The advantage in installing a cache handler module is that the caching engine (APC, Memcache, etc) is used instead of the database for all Drupal cache data, allowing for a sitewide performance increase regardless of whether pages are cached or not.

How effective is Authcache?

Caching prerendered HTML and gzipping using maximum compression allows for extremely fast page response times. When debug mode is enabled for Authcache, benchmarks are displayed. It's possible for Drupal+Authcache+APC to retrieve cached pages in under 1 millisecond. This represents a huge performance increase and the potential to handle hundreds of page requests/second!

What are the disadvantages?

In addition to more development time and testing, user-customized elements need to be scaled back. Please consider your goals and site functionality carefully, as the final HTML of each cached page must be the same for each user role. Cookies and the Ajax Drupal SESSION bootstrap (mentioned above) do allow for some minor customization. Extra modules/JavaScript may be needed to allow blocks of personalized content (authcache_example.module is included to demonstrate this usage). Also, hooks for contributed modules may need to be added for compatibility. This module is probably not suitable for Facebook-type sites where each page contains heavy user-centric content.


Authcache Docs (7.x-2.x)

Authcache Handbook (Drupal 6)


Project information