Speed and security

How to improve website speed

Measure first, then fix the biggest problems in order: images, caching, server response time, and front end code. Hosting matters most for server response time; most other delays come from the page itself.

Updated 6 min read

Start by measuring, not guessing

The quickest way to improve website speed is to find the one or two things that cost the most time and fix those first. Guessing leads to installing five plugins that each save a few milliseconds while a 4 MB banner image stays on the home page.

Run your home page and one important inner page (a product, service or contact page) through PageSpeed Insights. It shows two kinds of data:

  • Field data from real Chrome users over the last 28 days, if your site has enough visitors.
  • Lab data from a simulated test, useful for finding specific problems.

Test the mobile result first. A large share of visitors in India arrive on phones, often on mobile data, so the mobile score reflects what customers actually experience.

Core Web Vitals in plain language

Google groups user experience into three Core Web Vitals. The thresholds below come from web.dev and are measured at the 75th percentile of page loads.

Metric What it measures Good
Largest Contentful Paint (LCP) How long until the main content (usually the hero image or heading) appears 2.5 seconds or less
Interaction to Next Paint (INP) How quickly the page responds when someone taps or clicks 200 ms or less
Cumulative Layout Shift (CLS) How much the layout jumps around while loading 0.1 or less

One more number matters for hosting: Time to First Byte (TTFB), the time between the browser asking for the page and the server starting to reply. It is part of LCP. A high TTFB points to the server, the application or the database. A good TTFB with a poor LCP points to the page itself.

Fix things in this order

The list below is ordered by how often each fix makes a real difference on small business sites, and by how cheap it is to try.

1. Optimise images

Images are the most common cause of a slow LCP.

  • Resize to the size actually displayed. A 4000 px camera photo shown at 800 px wastes most of its bytes.
  • Compress and use modern formats. WebP and AVIF are usually much smaller than JPEG or PNG at the same visual quality.
  • Lazy load images below the fold with loading="lazy", but never lazy load the hero image, because that delays LCP.
  • Set width and height on images so the browser reserves space and the layout does not jump (this fixes many CLS problems).
<img src="/images/shop-front-800.webp" width="800" height="533"
     alt="Front of our Bhubaneswar shop" loading="lazy">

2. Turn on caching

Caching avoids doing the same work twice.

  • Page caching stores the finished HTML of a page so WordPress or another CMS does not rebuild it from PHP and database queries on every visit. For WordPress, a caching plugin usually does this.
  • Browser caching tells visitors' browsers to keep static files (images, CSS, JavaScript) for a while. You control it with the Cache-Control header.
  • Object caching keeps database query results in memory. It helps busy WordPress or WooCommerce sites and usually needs Redis or Memcached on the server, which is more common on a VPS.

A typical Apache .htaccess rule for long browser caching of static files:

<IfModule mod_headers.c>
  <FilesMatch "\.(webp|avif|jpg|png|svg|css|js|woff2)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
  </FilesMatch>
</IfModule>

Only use a one year max-age on files whose names change when their content changes, otherwise visitors may see old versions.

3. Use a CDN for static files

A content delivery network (CDN) keeps copies of your static files in many locations and serves each visitor from a nearby one. It reduces distance and takes load off your server. Many CDNs have a free tier suitable for small sites. Setting one up usually means changing nameservers or adding a CNAME, so read how to connect a domain to hosting first if DNS is new to you.

4. Run a current PHP version

PHP is the language WordPress and most CMS platforms run on. Newer PHP releases are generally faster, and versions past end of life no longer get security fixes. The PHP supported versions page shows which releases are still maintained.

On many cPanel servers you change this in MultiPHP Manager or a PHP selector, depending on what the host enables. Follow changing the PHP version in cPanel, and test on a staging copy first, because old plugins can break on a newer version.

ODHOST note: Which PHP versions are available, and whether you can switch them yourself, depends on the server setup. Check the PHP options in your cPanel or ask support through a ticket.

5. Clean up the database and plugins

Over time a WordPress database collects post revisions, spam comments, expired transients and data from deleted plugins. A cleanup plugin or a careful session in phpMyAdmin can help, especially for older sites.

Plugins matter more. Each one can add scripts, styles and database queries to every page. Deactivate plugins you do not need, then measure again. Page builders and sliders are frequent culprits.

Always take a backup before cleaning a database.

6. Trim front end code

If INP is poor, the cause is usually JavaScript: chat widgets, tracking tags, sliders and heavy themes. Remove what you do not use, delay non essential scripts, and load third party tags (analytics, chat, ads) only where needed. If your fonts are slow, host them yourself and use font-display: swap.

What your hosting controls, and what it does not

It helps to separate the two, so you spend money in the right place.

Mostly the hosting Mostly the website
Server response time (TTFB) under normal load Image sizes and formats
CPU, RAM and process limits Number of plugins and scripts
Storage speed (for example NVMe vs older disks) Theme and page builder weight
Server location and network Layout shifts and fonts
Available PHP versions and caching software Third party tags and widgets

Storage type affects how quickly the server reads files and databases. ODHOST shared plans list NVMe storage; the guide on what NVMe storage is explains what that means in practice.

When to upgrade your hosting

Upgrading is the right fix when the server is the bottleneck. Signs include:

  • TTFB stays high even with page caching on.
  • Your control panel shows you hitting CPU, memory or process limits (many cPanel servers show this under Resource Usage, if the host enables it).
  • The site slows down only at busy times, such as during a sale or after a WhatsApp campaign.
  • You need server level caching (Redis), background workers or custom software that shared hosting does not allow.

A VPS gives your site dedicated resources rather than sharing them. ODHOST's VPS plans run on servers located in India, close to Indian visitors. The comparison of shared vs VPS hosting explains the trade offs, including the extra server management a VPS brings.

If your site is slow because of images or scripts, a VPS will not fix it. Do the steps above first.

A one hour speed plan

If you only have an hour this week:

  1. Test the home page on mobile in PageSpeed Insights and note LCP, INP, CLS and TTFB.
  2. Compress and resize the three largest images it lists.
  3. Turn on page caching.
  4. Deactivate one plugin or widget you do not need.
  5. Test again and compare.

Repeat monthly. Speed slips as content and plugins pile up, so treat it as maintenance, not a one time project. If you are not sure which plan suits your traffic, the hosting plan finder gives a starting point.

Frequently asked questions

What is a good page load time?

Use Core Web Vitals rather than a single load time. Google's guidance is a Largest Contentful Paint of 2.5 seconds or less, Interaction to Next Paint of 200 milliseconds or less, and Cumulative Layout Shift of 0.1 or less, measured at the 75th percentile of visits.

Does website speed affect SEO?

Core Web Vitals are part of the page experience signals Google Search uses, but relevance of content matters more. Speed has a larger and more direct effect on whether visitors stay, enquire and buy.

Will upgrading my hosting plan make my site faster?

Only if the server is the bottleneck, which you can see from a slow Time to First Byte or resource limit warnings. If your images are heavy or your theme loads too many scripts, a bigger plan will not fix it.

Should I host my website in India if my customers are in India?

Server location affects network latency, so a server closer to your visitors usually responds sooner. A CDN can also serve static files from locations near your visitors wherever the origin server is.

Sources and further reading

Contact us