Chapter 12. Accompanying Extensions
What each part of JCH Optimize does: the Joomla component, plugins and administrator modules, and the WordPress plugin and its helpers. Useful when you look through your list of installed extensions or plugins and wonder what each one is for.
On Joomla Joomla
The pkg_jchoptimize package installs these extensions together. Leave them all
enabled unless this section says otherwise; uninstalling the package removes them together.
| Extension | Type | Edition |
|---|---|---|
| JCH Optimize | Component | Free and Pro |
| System - JCH Optimize | Plugin | Free and Pro |
| System - JCH Optimize Page Cache | Plugin | Free and Pro |
| System - JCH Optimize Administrator Menu | Plugin | Free and Pro |
| User - JCH Optimize User State | Plugin | Free and Pro |
| Console - JCH Optimize | Plugin | Pro |
| Task - JCH Optimize | Plugin | Pro |
| Web Services - JCH Optimize | Plugin | Pro |
| JCH Optimize Mode Switcher | Administrator module | Free and Pro |
| JCH Optimize Dashboard Icons, JCH Optimize Copyright, AI-Assisted Optimization | Administrator modules | Free and Pro; AI-Assisted Optimization is Pro |
The System - JCH Optimize Plugin
Does the optimizing. When Joomla has built a page, this plugin takes the finished HTML, optimizes it and hands it back to Joomla to send to the visitor. It also answers the reports sent by Page Experience and the one-time verification request made when a site is enrolled for AI-assisted optimization. All its settings are in the component.
Disabling this plugin stops all optimization. To do that temporarily, use the Mode Switcher instead, which also clears the cache when you switch back.
Ordering the JCH Optimize Plugin
Because it works on the finished page, this plugin must run after all other plugins that change the page, and before any page cache plugin, so the cache stores the optimized page. It is placed correctly when you install or update JCH Optimize. If you install other plugins or change the plugin order, click in the dashboard's Utility Tasks to put it back in place.
The System - JCH Optimize Page Cache Plugin
The page cache. It stores each optimized page and sends the stored copy to the next visitors, which greatly reduces your server's response time. It runs after the System - JCH Optimize plugin, so what it stores is already optimized. Logged-in users are never served cached pages.
Switch it on or off with the Mode Switcher, or in Joomla's plugin manager; configure it on the Page Cache tab of the settings page (see the section called “Page Cache Tab”). Keep only one page cache plugin enabled; if you prefer another, see the section called “Use a Different Page Cache Plugin”.
Noteworthy Features
- Serve Cached Pages as Static Files Pro
-
Saves cached pages as plain files that the web server sends directly. See the section called “Going Further: Serving Pages Without PHP”. It sets a small cookie for logged-in users so they can be recognized without starting Joomla.
- Excluding form users
-
When a visitor submits a form (a contact form, adding to a cart), the page they see next is usually meant for them alone. JCH Optimize sets a small cookie when a form is submitted and stops serving that visitor cached pages until the cache expires, while everyone else still gets them. Turn it off with Exclude form users if your site submits forms in the background (for example with Ajax) and doesn't need it.
An extension can serve the visitor cached pages again sooner, for example after they empty their cart; see the section called “Serving Form Users Cached Pages Again”.
The User - JCH Optimize User State Plugin
Sets and removes the small cookies that tell the page cache a visitor is logged in or has submitted a form, using the cookie settings in Joomla's Global Configuration. Keep it enabled.
Serving Form Users Cached Pages Again
With Exclude form
users on, a visitor who submits a form isn't served cached pages until the
page cache lifetime has passed. Only the extension that handled the form knows when its pages
stop showing what the visitor submitted, for example when a guest empties their shopping cart.
That extension, or a small plugin of your own, can then trigger the
onJchOptimizeUserPostFormDeleteCookie event, and this plugin removes the cookie, so
the visitor is served cached pages again from their next page:
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\Event\Event;
// Joomla loads user plugins only for some requests, such as logging in
PluginHelper::importPlugin('user');
Factory::getApplication()->getDispatcher()->dispatch(
'onJchOptimizeUserPostFormDeleteCookie',
new Event('onJchOptimizeUserPostFormDeleteCookie')
);
Trigger it before the page is sent, during the request that empties the cart, for example. It does nothing for a visitor who hasn't got the cookie. Only trigger it when the visitor's pages are the same as everyone else's again, since they will be served the pages cached for all guests.
JCH Optimize itself triggers onJchOptimizeUserPostForm when a visitor submits a
form, and this plugin sets the cookie in response.
The Console - JCH Optimize Plugin
Adds JCH Optimize's commands to Joomla's command-line application, so you can delete expired cache and, in JCH Optimize Pro, run Recache, image optimization and Page Experience processing from your server's CRON. The commands are described in Command-Line Reference.
Using the Joomla CLI Application
Joomla's command-line application is the file cli/joomla.php in your site's
folder. You run it with PHP, followed by the command:
$ php /path/to/site/cli/joomla.php jchoptimize:recache
Run it without a command to list every available command, or with help and a
command name for that command's options:
$ php /path/to/site/cli/joomla.php help jchoptimize:recache
Because a command run from CRON isn't part of a visit to your site, JCH Optimize doesn't know your
site's address. Give it with --live-site=,
or set https://www.example.com/$live_site in Joomla's configuration.php.
Tip
Your hosting control panel usually has a Cron Jobs page where you can add
these commands. Use the full path to PHP that your host gives you, and add --quiet
so CRON doesn't email you the output every time.
The Task - JCH Optimize Plugin
Adds JCH Optimize's task types to Joomla's Scheduled Tasks, so they run without setting up CRON:
-
JCH Optimize - Delete expired cache deletes expired files from the cache. Installing JCH Optimize creates a daily task of this type. See the section called “Delete Expired Cache on a Schedule”.
-
Pro JCH Optimize - Recache fills the page cache by crawling your site. See the section called “Keep the Page Cache Warm with Recache”.
The Web Services - JCH Optimize Plugin Pro
Adds JCH Optimize's addresses to Joomla's Web Services, so another system can delete cached pages: all of them, or the pages it lists. Installing the Pro package enables it. Disable it to switch these addresses off. See the section called “Delete Cached Pages from Another System”.
The JCH Optimize Mode Switcher Module
Sits in the status bar at the top of every administrator page. Its menu:
-
switches between Production and Development mode (see the section called “Pause JCH Optimize While You Work on Your Site”);
-
switches the integrated page cache plugin on or off;
-
shows the number of cache files and their size, and which page cache plugin is integrated;
-
deletes all of JCH Optimize's cache with .
Its color shows the state at a glance:
Page Cache Integration
Which page cache plugin the Mode Switcher controls, and whether it follows the mode, is set on the Page Cache tab of the settings page. See the section called “Use a Different Page Cache Plugin”.
Further Configuring the Mode Switcher Module
The module shows each user what their permissions
allow. Users who can change the settings (Configure Options) get the whole
menu. Users who can only clear the cache (Clear Cache) get the size of the
cache and . Everyone else doesn't see the module. To move it
or hide it for everyone, go to
→ → ,
search for JCH Optimize Mode Switcher and open it.
The Dashboard Modules
The panels of JCH Optimize's dashboard are administrator modules placed on the component's dashboard: one JCH Optimize Dashboard Icons module for each panel of icons, the Copyright module and, in Pro, the AI-Assisted Optimization module, which is placed first. Use the gear icon on a panel to edit, move or hide it; see the section called “The Dashboard” for what each panel contains.
Note
If a panel has disappeared from the dashboard, look for it in
→ →
and check that it is published in the position cpanel-com-jchoptimize-cpanel.
On This Page