On this page
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