Get a free website with any plan

See how
SPEED AND CACHING

LiteSpeed Cache: page optimization (CSS, JS)

Last updated

IN SHORT

LiteSpeed Cache page optimization on Flashcloud shrinks cached WordPress HTML, CSS, and JavaScript to speed up browser parsing. It runs on top of server caching. Turn settings on one by one starting with Minify, because combining files or delaying scripts can break layouts and interactive buttons.

Enable page optimization settings one at a time, starting with Minify, and check your site after each change. Aggressive combination and deferred JS are the two settings most likely to break a theme or plugin.

On Flashcloud, the plugin is pre-installed and pre-configured on every WordPress site as part of the stack described in the cache stack we ship with every WordPress install. Page optimization is a layer on top of that: it doesn't cache pages, it makes the HTML that gets cached smaller and faster to parse.

Where the settings live

In wp-admin, the LiteSpeed Cache plugin's settings menu covers CSS, JS, and HTML. Each option has an info icon with a plain-language description, but the effect of combining several of them isn't always obvious until you look at the rendered page.

CSS settings

  • Minify: strips whitespace and comments from your CSS files. Low risk, turn it on first.
  • Combine: merges enqueued stylesheets into fewer files to cut the number of requests. This can break themes that rely on CSS load order (a later stylesheet intentionally overriding an earlier one), since combining preserves order but some build tools don't enqueue cleanly. If styles look wrong after enabling it, that's the first setting to revert.
  • Unused CSS removal: removes CSS rules not used on a given page. Powerful for page weight but the most likely CSS setting to strip a rule your theme needs for a conditional element (a mobile menu, a modal). Check your header, footer, and any popups after enabling.
  • Asynchronous loading: defers non-critical CSS so it doesn't block first paint. Pairs with the next setting.
  • Critical CSS: generates the above-the-fold CSS needed for immediate render and inlines it, letting the rest load async.

JS settings

  • Minify: same idea as CSS minify, strips whitespace and comments. Safe to enable.
  • Combine: merges JS files into fewer requests. Same caveat as CSS combine: scripts that depend on a specific global load order can break. If you see console errors like "X is not defined" after enabling it, that's your signal.
  • Deferred loading: delays JS execution until after the page renders, which improves perceived load speed but can break scripts that need to run immediately (some analytics snippets, some sliders that measure the DOM on load).
  • Delayed execution: goes further and holds JS until the browser detects user interaction (scroll, click, mouse move) or a timeout. Biggest speed win, biggest risk of a broken "click to open" button if that button's own script gets delayed with everything else. Use the plugin's exclude list for anything interactive that needs to work instantly.

How to roll changes out

Enable one setting, save, then load the site in an incognito window (not a cached admin session) and click through your key pages: homepage, a product or post page, any page with a form or interactive widget. Check the browser console for JS errors. If something's off, disable the last setting you changed before touching anything else.

The exclude fields under each setting let you carve out specific files by URL pattern instead of disabling the feature site-wide. That's usually the better fix once you've identified the culprit: exclude the one problem file rather than giving up the optimization entirely.

How this fits with the rest of the cache stack

Page optimization works alongside, not instead of, the server-level caching described in how we make your site fast. LSCache handles whether a page is served from cache at all; page optimization handles how heavy that page's CSS and JS payload is once it's served. Both matter, but if a page isn't caching at all, fix that first; a smaller payload on an uncached page is still slower than a cached page with unoptimized assets.

When to contact support

If you've isolated a setting that breaks your site and excluding the specific file doesn't resolve it, or you're not sure which combination of settings is causing an issue, open a ticket from the portal under Support → New ticket. A real person will look at the specific conflict.

Common questions

Why did my site layout break after turning on CSS optimization?

CSS combine or unused CSS removal broke the design. Combining changes stylesheet load order, and removing unused rules can strip styles needed for popups or mobile menus. Turn off combine first, or use an exclude rule.

Why are my buttons or mobile menus not working?

Delayed or deferred JS execution stopped the script from running. Scripts tied to clicks break if they are held back until user interaction. Add the interactive script URL pattern to the exclude list.

Which page optimization setting should I turn on first?

Start with CSS and JS minify. Minifying removes whitespace and comments without changing execution order, making it the safest setting. Test your site in an incognito window after turning it on.

What should I do if I see an undefined error in the browser console?

Disable JS combine immediately. That console error means scripts loaded out of their required order because they were merged into a single file. Exclude the affected file from combining if you want to keep the setting on.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.