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. Anonymous caching won't require any changes and will offer a speed improvement over Drupal core since hitting the database can be completely avoided.

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 SESSION bootstrap 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). If a user logs in with JavaScript disabled, they will not receive the cached version of pages.

What type of caching is used?
You have many options:

  1. Drupal database — By default, Authcache will use the the "cache_page" table to store cached pages. To avoid hitting the database, download and install a cache handler module...
  2. Contributed cache handler module (recommended):
    1. Cache Router — This module supports APC, eAccellerator, XCache, Memcache, and the file system.
    2. 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.
    3. 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!

Example of Authcache + Debug Mode
http://authcache.jonahellison.com

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

Project Information

Downloads

Recommended releases

Version Downloads Date Links
6.x-1.0-rc2 tar.gz (34.1 KB) | zip (41.97 KB) 2010-Feb-22 Notes

Development releases

Version Downloads Date Links
7.x-1.x-dev tar.gz (37.64 KB) | zip (42.69 KB) 2012-Feb-02 Notes
6.x-1.x-dev tar.gz (37.74 KB) | zip (45.03 KB) 2011-Feb-25 Notes

Maintainers for Authenticated User Page Caching (Authcache)

  • simg - 12 commits
    last: 1 week ago, first: 1 week ago
  • Jonah Ellison - 27 commits
    last: 1 year ago, first: 2 years ago

Issues for Authenticated User Page Caching (Authcache)

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Oldest open issue: 10 Mar 09