Download & Extend

Authenticated User Page Caching (Authcache)

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.

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 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.

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:
Boost (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
External (In development 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 a caching reverse proxy like varnish (see #1981884: Add support for varnish (VCL and ESI))

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.

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.

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 Handbook (Drupal 6)

Downloads

Recommended releases

Version Downloads Date Links
7.x-1.4 tar.gz (40.92 KB) | zip (48.59 KB) 2013-May-09 Notes
6.x-1.0-rc2 tar.gz (34.1 KB) | zip (41.97 KB) 2010-Feb-22 Notes

Development releases

Project Information


Maintainers for Authenticated User Page Caching (Authcache)

  • znerol - 359 commits
    last: 2 days ago, first: 19 weeks ago
  • simg - 42 commits
    last: 18 weeks ago, first: 1 year ago
  • Jonah Ellison - 27 commits
    last: 2 years ago, first: 4 years ago

Issues for Authenticated User Page Caching (Authcache)

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Statistics (2 years)
New issues
Open bugs
Participants
nobody click here