Last updated July 8, 2013. Created by Jonah Ellison on December 13, 2010.
Edited by znerol. Log in to edit this page.

Authcache uses Ajax to retrieve dynamic content for cached pages after page load.

Authcache Ajax Steps

The process Authcache uses is as follows:

  1. authcache.js -- Send JSON request to ajax/authcache.php (via authcache.inc) in this format: {"function_name" : "arguments"}
  2. ajax/authcache.php -- Call PHP functions _authcache_function_name("arguments") and return new JSON object: { "function_name" : "return value"} (note the "_authcache_" prefix to the function names ... this is for security reasons)
  3. authcache.js -- Receive new JSON object and call JavaScript functions _authcache_function_name("return value") to update page content or whatever else is required

This allows the Ajax phase to be fairly modular for easy updating so developers may add their own custom dynamic content. The ajax/authcache_custom.default.php may be copied to the settings directory and used to process custom Ajax requests.

All these steps may seem like a fairly lengthy/slow process, but with the continued optimization of JavaScript engines in modern browsers and client CPU speed increasing every year, it is actually fairly responsive.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.