No results found

Try a different search query

Popular searches:

Add to Cart

Cart

You have no purchases yet

Browse Marketplace
Original Subtotal:
Product discounts:
Quantity Discount:
Total:
View Cart
Speed, hosting and caching

OpenCart Is Slow: 12 Causes and How to Find Yours

Why an OpenCart store slows down: 12 common causes, from hosting and the database to modules, images and bots, plus a diagnostic order for 3.0 and 4.1.

10 min read

If OpenCart is slow, the cause is almost never the platform itself. A clean installation of 3.0 or 4.1 opens quickly. Slowdowns come from weak hosting, a cache that is disabled or misconfigured, a bloated database, heavy modules, unoptimized images, and the theme. Below are 12 typical causes, grouped by where they occur, along with the order in which to check them so you don't spend money on "accelerators" you don't need.

Where to start: is the server slow or the browser?

Before changing anything, split the problem into two parts. The first is server response time, or TTFB (Time To First Byte). This is how many seconds PHP and the database take to prepare the HTML page. The second is how long the browser then takes to load images, scripts, and fonts. These two problems are fixed in completely different ways.

The simplest way to measure TTFB is a command in the terminal or the Network tab in the browser's DevTools (the row for the document itself, the Waiting field).

curl -o /dev/null -s -w "TTFB: %{time_starttransfer}s\nВсього: %{time_total}s\n" https://ваш-магазин.ua/

Measure the home page, a category with a large number of products, a product pageThe page for a single product: photos, price, options, description, reviews. More in the glossary →, and search. For a store with no problems, TTFB typically stays within 0.2–0.6 s. The exact value depends on hosting and caching. If a category takes 2–5 seconds while the home page opens quickly, look for the problem in the database or modules, not in images.

SymptomMost likely group of causes
High TTFB on all pagesHosting, PHP, missing cache (causes 1–3)
Only categories, filter, or search are slowDatabase and queries (causes 4–6)
Slowdown after installing a moduleModules, logs, external APIs (causes 7–9)
TTFB is normal, but the page "crawls"Images, theme, scripts (causes 10–11)
Periodic failures at any time of dayBots and crawlers (cause 12)

To see which controller, model, or SQL query is consuming the time, you need a profiler. For OpenCart 3 there is a ready-made module, OCT Performance Profiler. It is a performance profiler that shows where page generation time is spent. With it, you don't have to guess: you see the slowest link and immediately move to the corresponding cause in the list below. Without additional modules, the approach from our article on profiling and debugging OpenCart will help.

Causes 1–3: hosting, PHP, and cache

1. Overloaded or cheap hosting

On shared hosting, your site shares the processor and disk with hundreds of others. While traffic is low, this goes unnoticed. Just launch an ad campaign or wait for a search bot to visit, and CPU limits are exhausted. Typical signs: TTFB spikes with no changes on the site, and the hosting panel shows CPU or I/O overages. A store with several thousand products and steady traffic usually needs a VPS or a plan with guaranteed resources.

2. Old PHP version and disabled OPcache

OPcache is PHP's built-in cache of compiled code. Without it, PHP re-parses hundreds of core and module files on every request. Check in the hosting panel or via phpinfo that OPcache is enabled and has enough memory allocated. Choose the PHP versionThe language version on the hosting. 3.0.4.1 requires at least PHP 7.3, while 3.0.5.1 and 4.1.0.4 require at least PHP 8.1; check extension compatibility before updating. More in the glossary → to match your OpenCart branch and installed modules. A newer version is usually faster, but old modules may break on it, so test on a copy of the site first.

3. Cache not configured

By default, OpenCart caches some data in files in the storage directory (categories, currencies, settings). What exactly is stored there and why the directory can grow to gigabytes is described in our article on the storage directory and cache. On heavily loaded stores, the file cache is replaced with Redis or Memcached: both the 3.0 and 4.1 branches have drivers for them. Technical details are in the article on session and cache drivers. A separate layer is full page caching for guests. The core doesn't include it; it is provided by modules. An example of such a solution is covered in the review of caching and PageSpeed with Jet Cache.

Causes 4–6: database

4. MyISAM tables and missing indexes

In OpenCart 3.0, tables are created with the MyISAM engine; in 4.1, with InnoDB. MyISAM locks the entire table during writes. While someone places an order or an import updates prices, product reads have to wait. Add to this modules that create their own tables without indexes. Start with an audit: which tables are the largest and which engine they use.

SELECT table_name, engine, table_rows,
       ROUND((data_length + index_length) / 1024 / 1024, 1) AS size_mb
FROM information_schema.tables
WHERE table_schema = DATABASE()
ORDER BY size_mb DESC
LIMIT 15;

Converting 3.0 tables to InnoDB (ALTER TABLE oc_product ENGINE=InnoDB;) usually produces a noticeable effect on stores with active orders. Do this only after a full backup, and preferably first on a test copy. How to find specific slow queries and which indexes to add is explained in the article on slow OpenCart queries.

5. Counting products in categories

The option that shows the number of products next to a category name (Category Product Count) runs a count across all categories in the menu on every page. On a catalog with tens of thousands of products, this is one of the most common causes of slow TTFB. Find it under System → Settings, on the Option tab, and turn it off if the numbers in the menu aren't critical to you.

Option tab: disable showing product counts in categories
Option tab: disable showing product counts in categories · OpenCart 4.1.0.4

Tables for sessions, module logs, views, and abandoned carts grow over time to millions of rows. Check them with the query above and clean out whatever you don't need for reports. Also look closely at search: OpenCart's standard search builds queries with LIKE. If search also covers product descriptions, it becomes slow on a large catalog. Alternatives are described in the article on how search works and where it breaks.

Causes 7–9: modules, logs, and external services

7. Heavy modules, OCMOD, and events

Each module adds its own queries and handlers. Especially expensive are blocks like "frequently bought together," "recently viewed," and "bestsellers" without caching, as well as "smart" filters that recalculate all combinations on every click. In 3.0, OCMOD modifications change core code. A careless modification can insert a query into a loop over products, so instead of one query, a hundred execute. The list of active modifications is under ExtensionsAdditional functionality: a module, a payment or shipping method, a feed, or a theme. They are managed in "Extensions → Extensions." More in the glossary → → Modifications. After disabling any modification, click Refresh.

OCMOD modifications list in 3.0: disable them one by one and measure TTFB
OCMOD modifications list in 3.0: disable them one by one and measure TTFB · OpenCart 3.0.5.1

A working way to find the culprit is a binary search: on a test copy, disable half of the modules, measure, then narrow down the range. In 3.0, this search can be shortened: a profiler such as OCT Performance Profiler, mentioned above, will show which module to start with. If the filter slows down on large categories, also see the article on configuring the product filter.

8. Error log growing by gigabytes

A module that throws Notices or Warnings on every request forces OpenCart to constantly append to the log file. We have seen an error.log several gigabytes in size, and writing to it became a bottleneck in itself. Check the Server tab in the settings: on a production site, displaying errors on screen is unnecessary, and logging is useful only when someone reads the log and fixes the causes. How to work through the entries is described in the article on the error log in OpenCart.

Server tab: displaying and logging errors
Server tab: displaying and logging errors · OpenCart 4.1.0.4

9. Synchronous requests to external APIs

A shipping module that calls an API for a list of branches every time checkout opens, a currency rate widget, or a CRM integration when an order is saved: all of these add the response time of someone else's server to your TTFB. If the external service is down, your checkout is down too. The right approach: cache reference data locally and update it on a schedule (cron), and send data to the CRM in the background.

Causes 10–11: images and theme

10. Unoptimized images

OpenCart generates thumbnails itself via resize and stores them in image/cache. The first opening of a category after clearing the image cache will be slow, because thumbnails are generated on the fly. This is normal. What isn't normal: product photos taken on phones at 5–8 MB each as originals, thumbnail sizes in the settings that don't match the actual sizes used in the theme, and images in descriptions inserted without any compression. The mechanics of thumbnails are covered in the article on resize in OpenCart. For Core Web VitalsGoogle's page quality metrics: speed, layout stability, responsiveness. More in the glossary →, you also need WebP and lazy loading for everything below the first screen.

11. Heavy theme, scripts, and fonts

Ready-made themes often load several sliders, a full icon library, five font variants, and a chat widget that loads before the content. Add to this advertising and analytics pixels. The server may respond in 0.3 s, while the page on mobile only becomes interactive after several seconds. The order of action: remove unused scripts, load fonts with font-display: swap, and defer third-party widgets. Details are in the guide on optimizing the template: fonts, scripts, critical CSS.

Cause 12: bots and parasitic traffic

The least obvious cause is not buyers but robots. SEO services, price aggregators, competitor scrapers, and simply junk crawlers can generate many times more requests than live visitors. It's worst when they crawl filter pages: each combination of parameters produces a new address, the cache doesn't help, and every request is heavy. A sign of the problem is load that grows at night or in waves without any increase in orders.

What to check:

  • the server's access.log: which User-Agents and IPs make the most requests and to which addresses;
  • whether the filter, sorting, search, and comparison addresses are blocked from indexing in robots.txtA file that prohibits indexing of service pages: cart, admin, search. More in the glossary →;
  • whether service routes such as route=product/search with arbitrary parameters are open for crawling;
  • whether rate limits are configured at the server or CDN level.

Blocking aggressive bots at the server or in Cloudflare often reduces load more than any code optimization. But don't accidentally block Googlebot: verify IPs via reverse DNS, not just the User-Agent, which is easy to fake.

Summary

When OpenCart is slow, first determine where the time is lost: on the server (high TTFB) or in the browser. Then check the causes from cheapest to most expensive:

  1. OPcache, a current PHP version, and a working cache: quick fixes that don't require code changes.
  2. Disabled product counts in categories, cleaning bloated tables, InnoDB for 3.0.
  3. Finding a heavy module or modification by elimination, and the error log order.
  4. External APIs: move them to cache and cron, not into every request.
  5. Images and theme: for healthy Core Web Vitals.
  6. Bots: restrict them and block filters from crawling.

Moving to a more expensive server makes sense when the first items have already been done and resources are still lacking. Other materials on hosting, cache, database, and images are collected in the section "Speed, Hosting and Cache".

FAQ

Will simply buying a caching module stop OpenCart from lagging?
Page caching speeds up browsing for guests, but it does not fix slow cart, checkout, search or admin. If the cause is in the database or a module, caching only hides it, so find the source of the delay first.
Why is the OpenCart admin slow while the storefront works fine?
The usual culprits are product lists with a large number of records, modules that add queries to the admin, and dashboard widgets that call external services. Check the error log and measure which admin page's response time keeps growing.
How many products can OpenCart handle without slowing down?
There is no hard limit: stores with tens of thousands of products run fast on a decent server with indexes and caching. The limit is set by hosting and by filter and search modules, not by the core itself.
Will the store get faster after upgrading from 3.0 to 4.1?
The upgrade itself does not guarantee a speed boost: 4.1 uses InnoDB, but themes and modules will have to be replaced, and they affect speed no less than the core. Upgrade for support and features, and tackle speed through diagnostics.
How often should you clear the OpenCart cache?
You don't need to clear the cache regularly for speed, since it exists for that purpose. Clear it after changes to modules, the theme or settings, and also if the cache directory has grown because of a module error.
Was this article helpful?
Thanks for your feedback!

Related articles

Didn't find the answer?

Ask the community: OpenCart developers answer on the forum.

Ask on the forum
We use cookies

We use cookies and similar technologies to improve your experience, analyse traffic, and show personalised ads. Read our Cookie Policy for details.