01Journal

Building lightweight web apps for mobile connections

Page weight, images, fonts, JavaScript, caching, offline mode: our practical techniques for apps that stay fast even on a 3G connection.

In the DRC, most users access the web from a phone, on a mobile network whose quality varies from one neighbourhood to the next and from one hour to the next. Data plans are expensive. In this context, every kilobyte counts: a heavy page is not only slow, it costs money to whoever loads it, and it drives people away.

Here are the practices we apply on every project. This website is a concrete example.

1. Set a weight budget

Before writing a line of code, we set a limit on the weight of each page (HTML, CSS, JavaScript, images and fonts included). This "budget" then acts as a referee: every new feature must fit within it. It is far easier than trying to slim down a finished website.

2. Images in the right format and size

Images often make up most of a page's weight. Three rules are enough to cut it sharply:

  • The WebP format, much lighter than JPEG or PNG at the same visual quality. On this website, every image uploaded in the admin is converted automatically.
  • Several sizes for each image (here 480, 960 and 1,600 pixels wide). The browser picks the one that fits the screen: a phone never downloads the image meant for a large screen.
  • Lazy loading: images further down the page are only downloaded when the user approaches them.

3. Fonts hosted on the site, and few of them

Every font is a file to download. We limit the number of variants (one or two weights per font), use the woff2 format, the most compact, and host fonts on the website itself rather than on an external service. It is faster, and it avoids passing visitors' browsing on to a third party.

4. As little JavaScript as possible

JavaScript is the most expensive resource for an entry-level phone: it has to be downloaded, then executed. Rather than building the whole interface in the browser, we generate pages on the server, as HTML, and only add JavaScript where it truly adds value.

For interactions (a form that submits without reloading the page, a filter), a small library such as HTMX is often enough. On this website, it is only loaded on the contact page.

5. Compress and cache

  • Compression (gzip, zstd) greatly reduces the size of the HTML, CSS and JavaScript exchanged.
  • Caching avoids downloading again what has not changed: a returning visitor does not reload fonts, style sheets or images already seen.
  • Versioned file names make it possible to cache these files for a long time, with no risk of showing an old version after an update.

6. Plan for the network dropping

On a mobile network, a drop in the middle of an action is common. A good application must plan for it:

  • save work in progress so it is not lost;
  • show a clear message rather than a blank page;
  • for business tools, offer an installable app (PWA) that works offline and syncs data when the network returns.

7. Test in real conditions

A website tested only on a fibre connection and a recent computer gives a false impression. We test:

  • with the slow-network simulation in browser developer tools (3G profile);
  • on real entry-level phones;
  • with Google's Lighthouse tool, aiming for a mobile score of at least 90.

In short

A lightweight application is not a cut-price application. It is faster for everyone, cheaper in data for your users, better ranked by Google and more pleasant to use. If you want to know where your website or application stands, a technical audit measures precisely what slows it down.

02

Digital transformation

Digital transformation in the DRC: five principles

Start from real use, aim for quick wins, adapt to local realities, train teams, measure: the principles of a digital transformation that delivers.

Want to discuss it?

We answer every question.