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

Start free trial

Update Lazy Load Settings

litespeed/update-lazyload-settings turns image and iframe lazy loading on or off, sets the placeholder image, and controls automatic image sizing.

Pair it with litespeed/update-media-exclusions, because lazy loading the images at the top of a page makes it feel slower rather than faster.

At a glance

Abilitylitespeed/update-lazyload-settings
ToolsetLiteSpeed Cache — toolset/litespeed
GroupLiteSpeed Cache › Images & Lazy Load
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

The above-the-fold problem

Lazy loading defers images until they are near the viewport. For a long page that is a clear win — twenty images below the fold are never fetched by a visitor who does not scroll.

For the images already in view it is a loss. They now load after the page has rendered rather than with it, which means the largest visible element arrives late — and that is precisely the thing page-experience metrics measure. The site scores worse while loading less.

So the standard configuration is lazy loading on, with the hero image and anything else above the fold excluded. The exclusion ability does that by source, class or parent class.

Iframe lazy loading is less fraught, because iframes are rarely above the fold and are individually expensive. It is usually worth having on.

Automatic image sizing adds width and height attributes where they are missing, which stops the page shifting as images arrive. Almost always worth it, and occasionally wrong on images that are sized by CSS in ways the attributes then fight.

The write is a patch, not a replacement. Send one key and one key changes; everything else in the area is left alone. The response names the keys that actually moved, so a payload that matched the existing values comes back with an empty list rather than a misleading success.

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:

Turn on lazy loading for images.

It resolves to one call:

{
  "ability": "litespeed/update-lazyload-settings",
  "parameters": {
    "settings": { "media-lazy": true }
  }
}

Worth knowing

  • Exclude above-the-fold images, or the site scores worse while loading less.
  • Iframe lazy loading is usually worth having on.
  • Automatic sizing prevents layout shift but can conflict with CSS-sized images.
  • Purge and look at the front end afterwards.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading