Advertising sustains the DA. Ads are hidden for members. Join today
On this page
Using the Authcache module for improving performance for logged-in users
- Authcache 101: Intro to the Magical World of Caching
- Authcache 2 - The big picture
- Authcache 2 recipe: Upgrade to Varnish and ESI
- Authcache 2 tuning guide - avoid the database
- Authcache 2 tuning guide - integrate with Cache Expiration module
- Authcache 2 tuning guide - optimize cache-hit ratio
- Authcache 2 tuning guide - reduce number of Ajax / ESI calls
- How Authcache Ajax works
- Installing Authcache 6.x
- Modifying your Drupal theme for Authcache
- Tutorial: Commerce Kickstart 2 and Authcache 2
How Authcache Ajax works
Last updated on
30 April 2025
Authcache uses Ajax to retrieve dynamic content for cached pages after page load.
Authcache Ajax Steps
The process Authcache uses is as follows:
- authcache.js -- Send JSON request to ajax/authcache.php (via authcache.inc) in this format:
{"function_name" : "arguments"} - 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) - 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.
Help improve this page
Page status: Not set
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion