litespeed/update-js-settings changes JavaScript handling: minify, combine, defer and delay.
Defer and delay are where sites break. When one does, hold the script back rather than turning the feature off.
At a glance
| Ability | litespeed/update-js-settings |
| Toolset | LiteSpeed Cache — toolset/litespeed |
| Group | LiteSpeed Cache › CSS, JS & HTML |
| Requires | LiteSpeed Cache, active on the site |
| Capability | manage_options |
| Safety | Writes data |
| Repeatable | Idempotent — running it twice leaves the same result |
| Ships in | AcrossAI Abilities Manager 0.0.34 and later |
Defer, delay, and what they do to a script
Deferring moves a script to run after the HTML is parsed. Most scripts are fine with that; the ones that are not are those that expect to run during parsing — inline code that calls a function the deferred file defines, anything using the old document-write pattern, libraries that register themselves for a later inline call.
Delaying goes much further: the script does not run until the visitor interacts with the page. That is excellent for analytics and third-party widgets and actively wrong for anything that has to render — a slider that only initialises on scroll looks like a broken slider until somebody scrolls.
Combining has the same ordering problem as CSS, with a sharper edge: a JS error in one combined file can stop every subsequent script in that file from running. One plugin’s bug takes out the whole bundle.
When one script breaks under combine or defer, the fix is to hold that script back rather than switching the feature off for the whole site. litespeed/update-optimization-exclusions is the right tool, and it keeps the benefit everywhere else.
Optimisation is the area of LiteSpeed most likely to break a site, and it breaks it in a way that is easy to miss: the page still loads, the HTML is still correct, and one script silently stopped running. Purge and look at the front end after every change here — including the pages you did not change, since optimisation is site-wide.
Input
| Name | Type | Required | What it is |
|---|---|---|---|
settings | object | Yes | A map of setting key to new value. Keys outside this area are refused, and the refusal lists what the area accepts. |
What comes back
| Name | Type | What it is |
|---|---|---|
updated | array | The keys that actually changed. An empty array means every value you sent was already set. |
settings | array | Every setting in the area after the write, in the read shape. |
success | boolean | Whether the call completed. |
message | string | A one-line summary of what happened, suitable for showing a human. |
error_code | string | Present only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation. |
Example
Ask your assistant:
Defer JavaScript on this site.
It resolves to one call:
{
"ability": "litespeed/update-js-settings",
"parameters": {
"settings": { "optm-js_defer": true }
}
}Worth knowing
- Delay is for analytics and widgets, not for anything that renders.
- A JS error inside a combined file can stop every later script in it.
- Exclude the offending script rather than disabling the feature.
- Check forms, sliders and analytics specifically after any change here.
Related abilities
- Update Optimisation Exclusions — the correct fix
- List Optimisation Exclusions — what is already held back
- Purge Generated CSS And JS — regenerate afterwards
Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager
Browse the rest: Every ability, by category