Chapter 13. Troubleshooting

Problems and Solutions

1. The site looks wrong

My site has lost all or most of its styling.

The browser can't load the optimized CSS file. Find out why:

  1. View the page's source (right-click the page, View page source) and find the link to a CSS file created by JCH Optimize. Its address contains jch-optimize or jchoptimize. Click it.

  2. What you see tells you the cause:

    The CSS appears

    The file is fine. A cache is probably serving an old copy of the page that points to files that have since been deleted. Clear all caches. If you use another page cache plugin, make its lifetime shorter than JCH Optimize's Cache lifetime.

    File not found, or a 404 error

    The file was deleted, or the address can't be reached. Clear all caches and reload. On Joomla, click Order Plugin on the dashboard. If you changed Optimized files delivery to PHP, set it back to Static CSS and JavaScript files. Also check that no other extension or plugin deletes all of your site's cache on a schedule.

    A 403 or 500 error

    The server refuses to send the file. Click Fix file permissions on the dashboard. If that doesn't help, a security extension or plugin, or a server rule, may be blocking files in JCH Optimize's folders, or the PHP delivery of the files; set Optimized files delivery to Static CSS and JavaScript files, or ask your host.

Part of the page looks different: wrong spacing, fonts, colors or layout.

Usually one CSS file doesn't like being optimized, or an error in it affects the rules after it. Find and exclude it as described in the section called “Finding the CSS File”. If Optimize CSS Delivery or Reduce Unused CSS is on, switch it off first to see whether it is the cause.

The top of the page briefly appears unstyled, or jumps into place, as it loads.

The critical CSS used by Optimize CSS Delivery or Reduce Unused CSS is missing something. Check the fold for that page and run the dynamic selectors helper on it. See the section called “Optimize CSS Delivery”.

Content jumps down while the page loads.

Something above it doesn't have its space reserved. See the section called “Add Image Attributes” and the section called “Custom CSS: Stop the Page Jumping”.

Images are missing, appear late, or are the wrong size.

Icons show as squares, or the fonts have changed.

The font files can't be loaded. If you use a CDN, it must allow fonts to be used by your site (CORS); see the caution in the section called “Use a Content Delivery Network (CDN)”. Otherwise, the CSS file that defines the fonts may use relative addresses that break when optimized; exclude it.

Google Fonts still load from Google with Optimize Fonts on.

Google Fonts are only served from your site while Serve Google Fonts from the site and Optimize CSS Files are on. If both are, your server couldn't download them, for example because it can't connect to other websites; JCH Optimize tries again an hour later, and its log on the Logs page says why. Fonts that a script adds after the page loads can't be served from your site.

Text sometimes shows in Arial or Times New Roman instead of my font.

With Font display set to Optional, a page keeps the fallback font when the web font doesn't load almost at once, usually on a slow first visit. The next page shows the web font. If that happens too often for you, choose Swap. See the section called “Choose how text shows while fonts load”.

2. Something doesn't work

A menu, slider, form, pop-up or other interactive feature has stopped working.

  1. If Reduce Unused JavaScript or Reduce DOM is on, switch them off. If that fixes it, see the section called “Reduce Unused JavaScript” or the section called “Reduce DOM”.

  2. Otherwise, find the JavaScript file causing it and exclude it, as described in the section called “Excluding a File That Breaks Something”. The automatic settings are a quick way to narrow it down: see the section called “Find the Highest Automatic Setting That Works”.

The problem only happens when I'm logged out.

That is expected: by default JCH Optimize doesn't optimize pages for logged-in users (see Disable logged-in users). It means JCH Optimize is involved. Always test in a private window.

My editor or page builder misbehaves.

Make sure Disable logged-in users is on, so JCH Optimize leaves your editing screens alone. If the page builder's preview runs on a special address, exclude it in Exclude urls.

The cart, login status or other personal content shows the wrong information.

A cached page is being shown to someone it wasn't meant for. Exclude those pages from the page cache (see the section called “Step 7: Page Caching”), and make sure Exclude form users is on. If you use Serve Cached Pages as Static Files, try switching it off.

3. Nothing seems to change

I don't see any difference after enabling JCH Optimize. Is it working?

  1. Make sure you are looking as a visitor: log out, or use a private window.

  2. Clear JCH Optimize's cache and any other cache, then reload.

  3. View the page's source. If JCH Optimize is working, the links to your original CSS and JavaScript files have been replaced with links to optimized files.

  4. If they haven't, make sure JCH Optimize is in Production mode, that the page isn't excluded, and that the System - JCH Optimize plugin is enabled. Then look for errors on JCH Optimize's Logs page (WordPress: the Logs tab). If nothing shows there, set Log level to Debug, reload the page as a visitor, and look again; set it back afterwards. Each page that isn't optimized gets an entry that says why, for example the page is excluded, the user is logged in, or another extensionplugin switched optimizing off with the jch_optimize_no_optimize filter, whose callbacks the entry lists. Download the log and include it if you ask for support.

Pages aren't served from the page cache.

Set Log level to Debug, load the page as a visitor, and look at JCH Optimize's Logs page (the Logs tab). Each page that isn't served from or stored in the page cache gets an entry that says why: for example, the visitor submitted a form, the page is excluded, or messages are waiting to be shown to the visitor. Set the level back afterwards.

Another extensionplugin can switch off the page cache too, for example a shop while a visitor has a cart. The entry then says another extension switched it off, and the entry before it lists the extensions listening to the onPageCacheSetCaching event, which Joomla's own page cache uses as wellcallbacks of the jch_optimize_page_cache_set_caching filter. Disable them one at a time to find the one responsible.

Changes I made to my CSS, JavaScript or content don't appear.

A cache still has the old version. Click Clean Cache, or switch to Development mode while you work and back to Production when you finish, which also renames the optimized files so browsers fetch the new ones. Clear your CDN or host's cache too.

My PageSpeed score didn't improve, or got worse.

  • Test fairly: clear the cache, load the page once yourself, then run PageSpeed two or three times. See the section called “Why Scores Go Up and Down”.

  • Look at which metric is poor. A slow server response (TTFB) needs the page cache; a slow LCP often needs image optimization and LCP Images; a high TBT needs less JavaScript. See the section called “The Metrics That Matter”.

  • Third-party content (adverts, chat widgets, embedded videos, tracking scripts) can outweigh everything else. Lazy loading iframes and Reduce Unused JavaScript help, but some of it may need to be reconsidered.

4. Pro services Pro

My AI-assisted optimization run stopped or was refused.

Look up the outcome in the section called “Run Outcomes”, or the message in the section called “Licensing Messages”. If the run seems stuck, check that the dashboard tab is still open; reopen the dashboard and click Start optimization run to resume it.

The Page Experience page shows no data.

  • Check the message at the top of the page: monitoring may be off, or your database may not be MySQL or MariaDB.

  • Allow a day or two: values appear once visitors have been measured.

  • On a site with little traffic, raise Share of page views measured.

  • If your pages are cached by a CDN or your host, clear that cache so pages include the measuring script.

  • Visits from logged-in users and excluded pages aren't measured, because those pages aren't optimized.

Image optimization fails, times out or stops.

  • Make sure your Download ID is entered and your subscription includes image optimization.

  • If it stops partway with a message about your plan's limits, your image credits for now are used up; they refill every hour. See the section called “When Your Plan's Image Credits Run Out”.

  • If uploads time out, lower File upload concurrency and set a small No. of files per package on the Optimize Images tab.