How to Make Your Website Load Faster on Mobile Data

Measure your page, learn the Core Web Vitals, then cut the data it costs visitors: lighter images, deferred scripts, fewer fonts, compression and caching.

AAyim Nelson27 Nov 20267 min read2

Most people who visit your website will do it on a phone, on mobile data. In Ghana that usually means a data bundle they paid for themselves, a signal that comes and goes between Accra and Kumasi, and a phone that isn't the newest model. A slow, heavy page doesn't just annoy them. It costs them money, and many will leave before it finishes loading.

The good news: most of the fixes are small, and you can make a big difference in an afternoon. This guide shows you how to measure your page, what "fast" means, and the changes that save the most data.

Every megabyte costs your visitors money

Imagine a bundle that works out at 10 cedis per GB. That's an example price, not a real tariff: real prices differ by network and change often. A few lines of Python show what page weight means for someone who opens your site every day:

PRICE_PER_GB = 10.00   # an example price in cedis, not a real tariff

pages = {"before": 4.8, "after": 1.2}   # page weight in MB (1 GB = 1,000 MB)

for label, mb in pages.items():
    cost = mb / 1000 * PRICE_PER_GB
    print(f"{label:<6} {mb} MB: GHS {cost:.3f} a visit, GHS {cost * 30:.2f} for 30 visits")

Output:

before 4.8 MB: GHS 0.048 a visit, GHS 1.44 for 30 visits
after  1.2 MB: GHS 0.012 a visit, GHS 0.36 for 30 visits

Pesewas per visit sound small, but they add up over a month, and a lighter page also loads faster on a weak signal. Cutting weight helps your visitors' pockets and their patience at the same time.

Step 1: Measure before you fix

Don't guess what's slow. Open your page in Chrome and press F12 to open DevTools:

  • In the Network panel, tick Disable cache and choose a slow throttling preset (such as Slow 4G or 3G), then reload. The bottom bar shows how many requests the page made and how much it transferred. Sort by Size to see the heaviest files.
  • In the Lighthouse panel, run a Mobile report. It scores the page from 0 to 100 and lists the fixes that would help most.
  • For a live site, PageSpeed Insights (pagespeed.web.dev) shows the same lab test plus, for sites with enough visitors, how the page performed for real Chrome users.

Write the numbers down. After each fix, measure again so you know it worked.

What "fast" means: Core Web Vitals

Google's Chrome team picked three metrics, called Core Web Vitals, for the parts of speed people feel most:

MetricWhat it measuresGoodPoor
LCP: Largest Contentful Painthow soon the main content (often the big image or heading) appears2.5 s or lessover 4 s
INP: Interaction to Next Painthow quickly the page responds to a tap, click or key press200 ms or lessover 500 ms
CLS: Cumulative Layout Shifthow much things jump around while loading0.1 or lessover 0.25

INP replaced the older First Input Delay (FID) metric in March 2024. A page passes when all three are good for at least 75% of visits. Now for the fixes, starting with the ones that usually save the most.

Step 2: Shrink your images

Images are usually the heaviest part of a page, so start here:

  • Use modern formats. WebP and AVIF photos are usually much smaller than JPEG or PNG at the same quality, and all current major browsers support them.
  • Don't send a huge file to a small screen. A 4000-pixel photo straight from a phone camera is wasted on a 400-pixel-wide screen. Resize it, and use srcset to offer a few sizes.
  • Always give width and height. The browser then reserves the right space before the image arrives, so the text doesn't jump (that's your CLS).
  • Lazy-load images further down the page, so people who never scroll that far never download them.
<!-- The main image at the top: load it early, never lazily -->
<picture>
  <source srcset="/img/kejetia-800.avif" type="image/avif">
  <source srcset="/img/kejetia-800.webp" type="image/webp">
  <img src="/img/kejetia-800.jpg" width="800" height="450"
       fetchpriority="high" alt="Kejetia Market, Kumasi">
</picture>

<!-- A photo further down: only downloaded when the visitor scrolls near it -->
<img src="/img/gallery-1.webp" width="600" height="400"
     loading="lazy" alt="Our team at a coding meetup in Accra">

The browser picks the first <source> it supports and downloads only that one file. fetchpriority="high" tells it the top image matters, which helps LCP. Never put loading="lazy" on that main image: lazy means "wait", the opposite of what you want.

Step 3: Stop scripts from blocking the page

A plain <script> in the <head> makes the browser stop building the page until the script has downloaded and run. On a slow connection, that's a blank screen. Add defer to your own scripts, and async to independent ones like analytics:

<script src="/js/app.js" defer></script>
<script src="/js/analytics.js" async></script>

defer scripts run in order after the HTML is parsed; async scripts run as soon as they arrive. While you're there, look hard at third-party scripts: chat widgets, several trackers, social buttons. Each one costs data and keeps the phone's processor busy, which hurts INP. Remove the ones you don't really need.

Step 4: Be kind with fonts

Every custom font file is another download, and while it loads, text can be invisible. Use one or two fonts, in the small woff2 format, and let the text show straight away in a fallback font:

@font-face {
  font-family: "Adinkra Sans";
  src: url("/fonts/adinkra-sans.woff2") format("woff2");
  font-display: swap;
}

body {
  font-family: "Adinkra Sans", system-ui, sans-serif;
}

font-display: swap means the text never hides. For the lightest page of all, use system-ui on its own: the phone's built-in font costs zero bytes.

Step 5: Compress and cache on the server

Two server settings save data on every visit:

  • Compression. HTML, CSS, JavaScript, JSON and SVG are text, and text compresses very well, often to a fraction of its size. Turn on Brotli or gzip on your server or host. You can check it in the Network panel: the response should have a Content-Encoding: br or gzip header. Don't bother compressing JPEG, WebP or video files: they're compressed already.
  • Caching. A file the browser has cached isn't downloaded again on the next visit. Build tools like Vite give files names with a fingerprint, such as app.3f9a1c.js, which change whenever the code changes. Those can be cached for a year:
Cache-Control: public, max-age=31536000, immutable

Give the HTML page itself a short cache (or no-cache), so visitors still get your updates quickly. A CDN, which serves copies of your files from servers close to your visitors, helps too.

A quick checklist

  1. Measure with throttling and Lighthouse, and write down the numbers.
  2. Convert photos to WebP or AVIF and resize them for the screen.
  3. Add width and height to every image.
  4. Lazy-load images below the fold, but never the main image.
  5. Add defer or async to scripts, and remove ones you don't need.
  6. Use fewer fonts, woff2 and font-display: swap.
  7. Turn on Brotli or gzip, and cache fingerprinted files for a long time.
  8. Measure again.

Go further

Each of these steps has more to it: reading a waterfall, the critical rendering path, srcset and sizes, preconnect and preload, HTTP/2 and HTTP/3, and performance budgets that stop a page from getting heavy again.

  • Web Performance covers all of it in short lessons, with Core Web Vitals, images, fonts, compression, caching, CDNs and budgets, written for real users on mobile data.
  • How the Web Works explains what happens underneath: DNS, HTTP requests and responses, headers, HTTPS and caching. It makes every speed fix easier to understand.

Start with one page, make it lighter, and measure the difference. Your visitors' data bundles will thank you.

Comments

Log in to join the conversation.

Loading comments...