Advanced

Ultra Ajax Performance Guide

Published · Last updated

What is Ultra Ajax?

Ultra Ajax is a mu-plugin (must-use plugin) that intercepts chat API requests early in the WordPress boot process. Instead of loading the full WordPress stack – themes, plugins, widgets, the works – it loads only the handful of classes needed to handle the chat request, processes it, returns JSON, and exits.

The result: chat polling and message sending complete in single-digit milliseconds instead of the 200-500ms a full WordPress REST API request typically takes.

Performance Tip

This is what makes short polling intervals affordable. Because each request skips the theme and every other plugin, the cost of a poll drops by more than an order of magnitude, so faster message delivery does not translate into meaningful extra server load.

How It Works

Installation

On plugin activation, ssc-fast-ajax.php is copied from the plugin’s mu-plugins/ directory into wp-content/mu-plugins/. WordPress automatically loads all files in this directory before any regular plugins, which is what gives Ultra Ajax its speed advantage.

Request Interception

When any request hits your server, ssc-fast-ajax.php runs before WordPress fully loads. It checks whether the request path matches one of the chat endpoints:

  • /wp-json/ssc/v1/poll – fetch new messages
  • /wp-json/ssc/v1/send – send a message
  • /wp-json/ssc/v1/session – start or resume a chat session
  • /wp-json/ssc/v1/auto-reply – trigger an automated reply

If the request does not match any of these routes, the mu-plugin returns immediately and WordPress continues loading as normal. Admin-facing routes are always handled by the full WordPress REST API so that authentication and permissions work correctly.

Minimal Loading

For matched routes, the mu-plugin loads only the classes it needs:

It skips the theme, all other plugins, widgets, sidebars, the admin bar, and everything else WordPress normally loads. The response is sent and die() is called before WordPress ever finishes booting.

Graceful Fallback

If the mu-plugin is missing, disabled, or encounters an error, the chat works normally through the standard WordPress REST API. It will just be slower. There is no loss of functionality – only a loss of speed.

Ultra Ajax is not a page cache

Ultra Ajax speeds up the chat’s own REST calls, it does not cache pages. If a full-page cache or CDN in front of your site caches the /poll response, replies can appear stale regardless of Ultra Ajax. Exclude /wp-json/ssc/ from caching, see Caching and CDN Compatibility.

Auto-Update

The installed mu-plugin is compared with the version shipped with the plugin when the settings page loads, on wp-admin pages (at most once an hour) and straight after a plugin update. A newer shipped version, or a missing file, is copied into place. This is handled by SSC_MU_Installer::check_and_update().

Verifying Ultra Ajax Is Active

There are three ways to confirm Ultra Ajax is running:

  1. Settings > Status tab – The status tab shows whether the mu-plugin is installed and its version number.
  2. Direct URL check – Visit yoursite.com/wp-json/ssc/v1/?is_ssc_ultra_ajax_active in your browser. A confirmation message, “Ultra Ajax is active, bypassing full loading of WordPress for chat AJAX requests.”, shows the mu-plugin is installed and answering chat routes; the Ajax Type in use is shown on the Status tab. The check answers only under the chat route, so it does not announce the plugin on the rest of your site.
  3. Behaviour tab indicators – In the Behaviour settings tab, polling interval descriptions will indicate “Ultra Ajax is active” and show lower default values.

Polling Intervals

With Ultra Ajax active, default polling intervals are more aggressive because each request is lightweight:

Polling PhaseWith Ultra AjaxWithout Ultra Ajax
Active (user engaged)1000ms2000ms
Idle (after ~30s inactivity)3000ms5000ms
Deep idle (after ~2 min)10000ms15000ms

All intervals are configurable in the Behaviour settings tab.

Lower intervals mean faster message delivery at the cost of slightly more server load. Because Ultra Ajax makes each request extremely cheap (a few milliseconds of PHP execution with no theme or plugin overhead), the more aggressive defaults are safe for the vast majority of hosting environments.

Choosing the Ajax Type

The Ajax Type on the Status tab decides how visitor chat requests are served:

Ajax TypeVisitor chat requests
Normal RESTA full WordPress load; every plugin runs
Fast RESTWordPress loads with only Super Speedy Chat and the plugins ticked under Plugins to keep loading in Fast mode
Ultra AjaxAnswered by the mu-plugin before WordPress finishes loading

The mu-plugin is installed whatever the Ajax Type. On Normal REST it leaves visitor requests alone.

The admin chat alert check

Available since 1.19.0.

Administrators’ browsers check for new chats every Poll Interval (see Chat Alerts and Replying From Any Page). On every Ajax Type, Normal REST included, that check loads only Super Speedy Chat and the plugins ticked under Plugins to keep loading in Fast mode. WordPress login and permission checks still run on it, and it is never answered by the Ultra path.

Plugin Deactivation

When Super Speedy Chat is deactivated or deleted, ssc-fast-ajax.php is deleted from wp-content/mu-plugins/. No cleanup required.

Rate Limiting

Ultra Ajax includes built-in per-IP rate limiting to prevent abuse:

EndpointLimit
/send15 requests/minute
/session10 requests/minute
/auto-reply3 requests/minute

The /poll endpoint is not rate-limited since it is read-only and needs to fire frequently.

When a client exceeds the limit, the mu-plugin returns HTTP 429 (Too Many Requests) with an error message.

Troubleshooting

Chat feels slow

Check the Status tab to confirm the mu-plugin is installed and the Ajax Type is Ultra Ajax or Fast REST. If the status shows the mu-plugin is missing, try deactivating and reactivating the plugin, which triggers a fresh install.

Mu-plugin fails to install

Some hosts restrict writing to wp-content/mu-plugins/. Verify that the directory exists and is writable by PHP (typically owned by www-data or your PHP-FPM user, with 0755 permissions). If the directory does not exist, the installer attempts to create it automatically.

Mu-plugin causes issues

To stop the mu-plugin answering visitor requests, set the Ajax Type to Normal REST on the Status tab. Deleting wp-content/mu-plugins/ssc-fast-ajax.php is safe, as chat falls back to the standard WordPress REST API, but the file is copied back on the next wp-admin visit or Status tab save. If the admin chat alert check misbehaves, tick the plugin it needs under Plugins to keep loading in Fast mode.

Discord messages not pushing

Ultra Ajax uses fastcgi_finish_request() (when available) to send the HTTP response to the visitor immediately, then pushes the message to Discord after the response is sent. If your server does not support fastcgi_finish_request(), Discord pushes happen before the response is sent, adding a small delay. This is normal on non-FPM setups (e.g., Apache mod_php).

Did you know?

The /poll endpoint is deliberately left out of rate limiting because it is read-only and needs to fire on every cycle. The write endpoints (/send, /session, /auto-reply) carry the per-IP limits instead, which is where abuse would actually cost you.

Further reading

tune the polling intervals Ultra Ajax makes affordable
keep a page cache or CDN from serving stale poll responses
broader first-stop fixes
how the network-wide mu-plugin behaves per site

Comments

▲
▼
1/1