Public Beta — use code LAUNCH15 for 15% off any plan
Back to blog

How to Speed Up Your cPanel Hosting Website (Practical Guide)

By Yoga · 02 Jun 2026 · 6 min read

How to Speed Up Your cPanel Hosting Website (Practical Guide)

If your website feels sluggish, the problem usually lives somewhere between your PHP configuration, database queries, and unoptimized assets. The good news: cPanel gives you direct access to fix most of these without touching a single server config file via SSH. This guide walks you through the real, actionable steps to speed up a cPanel-hosted website.

1. Upgrade to the Latest Stable PHP Version

This single change is often the highest-impact move you can make. PHP 8.2 and 8.3 are measurably faster than PHP 7.x — benchmarks consistently show 20–30% throughput improvements on real-world applications.

How to Change Your PHP Version in cPanel

  1. Log in to cPanel.
  2. Navigate to Software → Select PHP Version (sometimes labeled "PHP Selector" or "MultiPHP Manager" depending on your host's setup).
  3. Choose the latest stable PHP version available (8.2 or higher).
  4. Click Set as Current.

Before switching: Make sure your CMS, plugins, and custom code are compatible with the target PHP version. Run a staging test first if possible.

PHP Extensions to Enable

While you are in the PHP extension manager, enable these performance-relevant extensions:

  • opcache — bytecode caching (covered in depth below)
  • intl — improves string handling in frameworks like Laravel
  • redis or memcached — if your host supports object caching

2. Enable and Tune OPcache

Every time PHP runs a .php file, it parses and compiles the script to bytecode. OPcache stores that compiled bytecode in shared memory so subsequent requests skip the compilation step entirely. On a WordPress site with 300+ PHP files loaded per request, this is a massive win.

Enabling OPcache in cPanel's PHP INI Editor

  1. In cPanel, go to Software → MultiPHP INI Editor.
  2. Select your domain.
  3. Search for opcache settings in the editor.

Recommended values for a shared hosting environment:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.save_comments=1
Setting What It Does Recommended Value
memory_consumption RAM allocated for cached bytecode (MB) 128
max_accelerated_files Max number of PHP files cached 10000
revalidate_freq Seconds before checking if a file changed 60
interned_strings_buffer Memory for interned strings (MB) 16

On shared hosting you may not be able to set all of these. Set what cPanel allows and leave the rest at default.


3. Optimize MySQL with Query Caching and Indexes

Slow database queries are one of the top reasons pages take more than 2 seconds to load. cPanel gives you access to phpMyAdmin and, on many plans, MySQL Databases — use them.

Identify Slow Queries First

If you are running WordPress, install the Query Monitor plugin temporarily. It shows you exactly which queries are slow and where they originate.

For non-WordPress applications, enable the MySQL slow query log via SSH (if you have access):

SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;

This logs any query taking longer than 1 second.

Add Missing Indexes with phpMyAdmin

  1. Open phpMyAdmin from cPanel.
  2. Select your database, then the slow table.
  3. Click the Structure tab.
  4. Add an index on columns that appear in your WHERE and JOIN clauses.

Example: if your query filters by user_id and created_at, a composite index on both columns can cut query time from 800 ms to under 10 ms.

ALTER TABLE orders ADD INDEX idx_user_created (user_id, created_at);

WordPress-Specific: Enable Object Caching

If your host supports Redis or Memcached, enable object caching through your WordPress configuration. This caches the result of expensive database calls in memory so they are not repeated on every page load. Plugins like Redis Object Cache connect WordPress to an existing Redis socket automatically.


4. Compress and Optimize Images Before They Hit the Server

Images are typically 60–80% of a page's total transfer size. Compressing them before upload is more reliable than relying solely on server-side solutions.

Compression Workflow

Before uploading:

  • Use Squoosh (squoosh.app) or ImageOptim to reduce file size without visible quality loss.
  • Convert images to WebP format — it is 25–35% smaller than JPEG at equivalent quality.
  • Aim for hero images under 150 KB and thumbnails under 30 KB.

After upload (cPanel side):

  • In File Manager, you cannot bulk-compress images natively, but you can use a WordPress plugin like ShortPixel or Imagify that hooks into the media library.

Serve WebP Images via .htaccess

If you have pre-generated .webp versions of your images, you can serve them automatically to supporting browsers without changing your HTML:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_ACCEPT} image/webp
  RewriteCond %{REQUEST_FILENAME}.webp -f
  RewriteRule ^(.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>

<IfModule mod_headers.c>
  Header append Vary Accept env=REDIRECT_accept
</IfModule>

AddType image/webp .webp

Paste this into your .htaccess file via cPanel's File Manager → Edit.


5. Enable Gzip Compression and Browser Caching via .htaccess

These two settings reduce the bytes transferred over the network and instruct browsers to cache static files locally.

Enable Gzip Compression

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml
  AddOutputFilterByType DEFLATE text/css text/javascript
  AddOutputFilterByType DEFLATE application/javascript application/x-javascript
  AddOutputFilterByType DEFLATE application/json application/xml
</IfModule>

Set Browser Cache Headers

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType image/jpeg "access plus 1 year"
  ExpiresByType image/webp "access plus 1 year"
  ExpiresByType image/png  "access plus 1 year"
  ExpiresByType text/css   "access plus 1 month"
  ExpiresByType application/javascript "access plus 1 month"
</IfModule>

With these rules, returning visitors load CSS and images from their local disk rather than re-downloading them. This can cut load time for repeat visits by 50% or more.


6. Use a CDN — But Set It Up Properly

A CDN is frequently recommended but rarely explained. Here is the short version: a CDN caches your static files (images, CSS, JS) on servers distributed around the world. When a visitor in Singapore requests your Indonesian-hosted site, they download static assets from a nearby CDN node rather than your origin server.

How to Configure Cloudflare (Free Tier) with cPanel

  1. Create a free Cloudflare account and add your domain.
  2. Cloudflare scans your existing DNS records — verify they are correct.
  3. Change your domain's nameservers to Cloudflare's (do this in your domain registrar, not cPanel).
  4. In Cloudflare's dashboard, set SSL/TLS mode to Full (Strict) — not just "Flexible".
  5. Enable Auto Minify for CSS, JS, and HTML under Speed → Optimization.
  6. Under Caching → Configuration, set the browser cache TTL to at least 1 month.

Cloudflare now sits in front of your origin server. Static requests are served from Cloudflare's edge; dynamic requests still hit your cPanel server but with far less load.


Putting It All Together: Quick Priority Checklist

Action Difficulty Impact
Upgrade PHP to 8.2+ Easy High
Enable OPcache Easy High
Add database indexes Medium High
Compress images to WebP Easy High
Enable Gzip + browser caching Easy Medium
Configure Cloudflare CDN Medium Medium–High
Enable Redis object caching Medium Medium

Start at the top of this list. PHP version upgrades and OPcache alone can cut server response time (TTFB) by 30–50% on a typical WordPress or PHP application. Layer in image optimization and caching headers, and you will likely pass Core Web Vitals without needing any paid tools.


Final Thoughts

Speeding up a cPanel website is not about finding a magic setting — it is about systematically removing bottlenecks. Start with PHP version and OPcache (free, instant), move to database optimization (requires a bit of analysis), and finish with asset delivery improvements like image compression and browser caching.

If you are looking for a cPanel hosting provider that ships with up-to-date PHP versions and OPcache pre-enabled, GoCelerus is worth checking out — especially if you are hosting in Southeast Asia and need low-latency connections for regional visitors.

Measure before and after each change using Google PageSpeed Insights or GTmetrix. Real numbers keep you honest and help you prioritize what to tackle next.

Welcome to GoCelerus

Save 15% on any plan

Launch promo — 15% off any plan

Your coupon code

LAUNCH15
Browse plans