30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Update JS Settings

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

Abilitylitespeed/update-js-settings
ToolsetLiteSpeed Cache — toolset/litespeed
GroupLiteSpeed Cache › CSS, JS & HTML
RequiresLiteSpeed Cache, active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI 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

NameTypeRequiredWhat it is
settingsobjectYesA map of setting key to new value. Keys outside this area are refused, and the refusal lists what the area accepts.

What comes back

NameTypeWhat it is
updatedarrayThe keys that actually changed. An empty array means every value you sent was already set.
settingsarrayEvery setting in the area after the write, in the read shape.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent 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


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading