Website performance is very important as your website gets traffic, to make sure visitors stay on your website and to improve user experience (UX). It also helps you stay visible on search engines (see Core Web Vitals).
Joomla is a popular content management system that can be used for many kinds of websites. According to W3Techs, Joomla is used by ~1.2% of all websites when I was writing this blog post.
However, Joomla can have many performance bottlenecks (such as slow database queries, redundant extensions, and more). In this blog post, I’m going to show you some performance optimizations you can apply for Joomla, along with some benchmarks to back them up with.
Benchmark methodology
But before going into the optimizations, here’s the benchmark methodology:
- The benchmark was done on Kubuntu 24.04, running on AMD Ryzen 7 8700G, with Linux kernel version 7.0.0-14-generic. The benchmarking tool ran on the same host as the server.
- I used Apache HTTP Server 2.4.66 (from Ubuntu 26.04) for the backend server and Ferron 3.0.0-beta.10 as an LSCache-compatible proxy.
- I downloaded Joomla 6.1.3 (latest when I was writing this post), running on PHP 8.5 (what I installed from Ubuntu 26.04). All benchmark runs had the default Cassiopeia theme with blog sample data.
- I used MariaDB for the database server.
- Access and error logging were enabled for both Ferron and Apache.
- Apache had
mod_phpenabled, while Ferron had HTTPS and HTTP/2 enabled (with self-signed certificate) - I set
ulimit -n 524288(raising file descriptor limit) - The benchmark command I used was
wrk -c 50 -t 8 -d 10s https://localhost.
I have also measured the baseline without any optimizations, just stock Joomla, Apache and Ferron. Here are the results:
Running 10s test @ https://localhost
8 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 332.15ms 230.81ms 1.76s 92.42%
Req/Sec 15.47 8.73 40.00 75.00%
908 requests in 10.02s, 33.94MB read
Socket errors: connect 0, read 0, write 0, timeout 41
Requests/sec: 90.66
Transfer/sec: 3.39MBWith that being said, let’s dive into the optimizations!
1. Enable Zend OPcache
Zend OPcache improves PHP performance by caching precompiled PHP bytecode, removing the need for PHP to parse scripts every time someone visits the website.
This can improve performance, especially for complex PHP scripts with lots of PHP logic.
To enable OPcache, find the [opcache] section in your PHP configuration (in my case it was /etc/php/8.5/apache2/php.ini), and add this below [opcache]:
opcache.enable=1
opcache.memory_consumption=128
opcache.max_accelerated_files=10000
opcache.revalidate_freq=200Then restart Apache or PHP-FPM:
sudo systemctl restart apache2Here are the benchmark results after enabling OPcache:
Running 10s test @ https://localhost
8 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 124.24ms 196.48ms 1.94s 95.63%
Req/Sec 50.00 20.77 171.00 85.69%
2731 requests in 10.02s, 101.97MB read
Socket errors: connect 0, read 0, write 0, timeout 52
Requests/sec: 272.64
Transfer/sec: 10.18MBThroughput improvement (over baseline): ~3.03x
2. Enable Joomla system cache (progressive or conservative)
Joomla offers system cache, which speeds up your website by storing rendered fragments of pages. This leads to fewer database queries.
There are two kinds of Joomla’s system cache:
- Conservative caching, which respects individual module settings; preferred for dynamic sites
- Progressive caching, which forces all modules to be cached no matter what individual settings; preferred for static sites
In my experience though, conservative caching turned out to be faster than progressive caching…
To enable conservative caching, navigate through Joomla’s administration panel: System (sidebar) -> Global configuration -> System (tab) -> Find “System Cache” -> Set it to “ON - Conservative caching” -> Press “Save”.
Here are the benchmark results after enabling conservative caching:
Running 10s test @ https://localhost
8 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 55.08ms 49.45ms 1.29s 99.32%
Req/Sec 114.67 16.53 171.00 81.00%
9144 requests in 10.01s, 341.49MB read
Requests/sec: 913.13
Transfer/sec: 34.10MBThroughput improvement (over OPcache alone): ~3.35x
3. Enable Joomla page cache
Joomla also offers a page cache, which caches entire pages, not just individual components. This improves performance even more, as there would be even less database queries.
To enable the page cache, navigate through Joomla’s administration panel: System (sidebar) -> Extensions (Manage) -> Search for “page cache” -> Enable extension
Then navigate again: System (sidebar) -> Plugins (Manage) -> Search for “page cache” -> Enable extension
Here are the benchmark results after enabling page caching:
Running 10s test @ https://localhost
8 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 63.24ms 173.16ms 1.07s 92.88%
Req/Sec 356.32 48.46 470.00 89.42%
25891 requests in 10.01s, 0.94GB read
Requests/sec: 2586.70
Transfer/sec: 96.58MBThroughput improvement (over OPcache + conservative cache alone): ~2.83x
4. Use an edge cache (like LSCache)
Using an edge cache (for example LSCache) improves website performance even more by bypassing PHP and Apache (which can be a large performance bottleneck) entirely, and serving from the edge when cache is hit.
LSCache is one such implementation of edge cache, created for LiteSpeed Web Server to improve website performance.
But in my case, I’m using Ferron 3, which also supports LSCache semantics.
Enabling LSCache depends on what web server you’re using. If you’re using LiteSpeed, you can enable it using LiteSpeed’s WebAdmin (or whatever is your administration panel). Many web hosting services offer hosting on LiteSpeed web servers that in many cases have LSCache enabled by default, so you don’t have to do anything.
In my case though, I added this to Ferron 3 host configuration and restarted the web server:
# Replace example.com with your domain
example.com {
# -- config snip --
cache {
litespeed_override_cache_control # This allows LSCache semantics instead of default RFC 9111 semantics
}
}Also, you’d install an LSCache plugin for Joomla:
- Download from https://www.litespeedtech.com/products/cache-plugins/joomla-acceleration (select archive corresponding to your Joomla version)
- In Joomla admin panel: System (sidebar) -> Extensions (Install) -> Upload Package File (tab) -> select downloaded LSCache plugin archive
- There may be warning that the plugin needs LiteSpeed Web Server when you’re using a different server than LiteSpeed’s offerings, you can ignore it.
Benchmark note: HTTP cookie must be set in wrk, otherwise LSCache will be bypassed all time!
To find the cookie to apply to wrk (-h "Cookie: $COOKIE_VALUE" additional argument):
- Run
curl -Ik https://localhost | grep -i set-cookie(replacelocalhostwith your website URL) - The string after
set-cookie:but before any semicolon would be theCookieheader value to use inwrk
Here are the benchmark results after enabling edge-level caching (though there were socket errors, but maybe this is system configuration issue):
Running 10s test @ https://localhost
8 threads and 50 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.96ms 68.29ms 1.55s 99.36%
Req/Sec 23.50k 7.81k 38.84k 66.01%
1791068 requests in 10.10s, 58.88GB read
Socket errors: connect 10422, read 30, write 0, timeout 35
Requests/sec: 177333.85
Transfer/sec: 5.83GBThroughput improvement (over PHP-level optimizations): ~68.55x
Note: I haven’t tested the Joomla performance optimizations described later on…
5. Keeping PHP updated
There are multiple performance benchmarks demonstrating newer PHP versions indeed improve throughput in comparison to older ones.
From https://phpbenchlab.com/php-8-5-vs-8-4-vs-8-3-performance-comparison-2026/:
Based on the complete picture now available from our comprehensive PHP version testing series, here is the ultimate upgrade guide:
Your Current Version Your Workload Recommended Action Expected Benefit PHP 8.3 CPU-heavy Upgrade to 8.5 +8.5% RPS PHP 8.3 I/O-heavy Optional ~0% (but get 8.5 features) PHP 8.4 CPU-heavy Upgrade to 8.5 +14.4% RPS PHP 8.4 I/O-heavy Optional ~0% (but fix potential regression) PHP 7.4 Any Urgently upgrade to 8.5 +100%+ (Engine improvements + security)
If you’re using a shared or cloud hosting service, you might see a PHP version selector.
Oh, and there are providers that charge more for using older PHP versions. From https://www.netart.com/us/php-databases/:
Do you want to continue using the current version of PHP? At netart.com, it is possible thanks to the “Support for older versions of PHP” service. The price for this service is £12.50/mo.
6. Remove unnecessary extensions
Unused or unnecessary extensions can degrade Joomla performance (maybe even a lot), because of unnecessary database queries, too large CSS and JavaScript, and more HTTP requests.
It’s recommended to uninstall them entirely using Joomla’s administration panel. You can do so by navigating: System (sidebar) -> Extensions (Manage) -> Search for extensions to remove -> Select extensions you want to remove -> Click “Uninstall”.
7. Enable static asset compression
Compressing HTTP static files improves website performance by reducing data transfer it takes to load the website.
For Apache, you can configure mod_deflate in the web server configuration. For LiteSpeed, you can enable HTTP compression in the Web Admin Console.
8. Offload static file serving
Yes, even serving static files from Apache can be a bottleneck. Offloading static file serving to a faster server or a CDN would improve website loading performance, especially under scale.
For Apache, you can configure .htaccess like this:
<IfModule mod_headers.c>
<FilesMatch "\.(?:css|js|mjs|png|jpe?g|gif|svg|webp|ico|woff2?|ttf|eot)$">
Header set Cache-Control "public, max-age=2592000, immutable"
</FilesMatch>
</IfModule>9. Set caching headers
The ultimate performance optimization would be browser-level caching, which would bypass the network connection entirely and serve assets from the browser cache. Given varied network latency, this can improve the website visitors’ a lot, especially those on slow networks.
You can set Cache-Control headers for that, the example of which in .htaccess I have shown in the previous point.
Conclusion
Websites running on Joomla can be optimized in various ways, like PHP-level caches (OPcache, Joomla’s caching features), edge-level caches (LSCache and similar), browser-level caches, and more.
Benchmarks also show that edge-level caching gets you larger fast-path gains than PHP-level caches, though I recommend combining browser-level (fastest path), edge-level (fast path) and PHP-level (slow path).
With that said, let’s improve your website’s performance and visitors’ experience!