How to improve your website speed: the complete guide
A practical guide to speeding up a slow website: diagnosis, images, code, hosting and caching. Concrete methods with measured gains on Tunisian websites.
Contents 8 sections
A slow website is expensive. In practice: beyond three seconds of loading time, more than half of mobile visitors leave the page before seeing your content. On Google, speed is also a ranking factor.
The good news: most performance problems can be fixed with a few well-targeted actions.
Step 1: measure before acting
Don’t guess. Measure.
- PageSpeed Insights — analyses a page and gives a score, with precise recommendations.
- WebPageTest — simulates loading from different devices and networks, with a frame-by-frame analysis.
- Chrome DevTools (Performance tab) — shows where the time is really spent.
- Search Console (Core Web Vitals report) — shows which pages Google considers slow, based on data from real visitors.
Always test on mobile. Desktop results often hide half of the problems.
Step 2: images, the leading cause of slowness
In our experience, poorly optimised images alone explain most slow websites.
What to do
- Use the right format. WebP reduces image weight by 25 to 35% compared with JPEG, at equivalent visual quality. AVIF does even better.
- Resize to the actual display size. A 4000-pixel-wide image displayed at 800 pixels wastes 90% of its size.
- Compress ruthlessly. A banner image should never exceed 150 KB.
- Defer loading. Images further down the page should load when the user reaches them, not before.
- Always set
widthandheight. This prevents layout shifts — one of the indicators measured by Google.
Typical gain
On a poorly optimised showcase website, fixing the images often brings an immediate gain of 2 to 3 seconds. It is the most cost-effective action.
Step 3: code and resources
Reduce unnecessary JavaScript
Each script loaded blocks page rendering. Review what your website actually loads:
- Multiple analytics trackers — one is enough.
- Live chat — useful, but load it only on click.
- Social sharing buttons — replace them with simple links, without third-party scripts.
- Outdated libraries — jQuery is no longer needed on a modern website.
Optimise CSS and fonts
- Load only the weights you use. Loading a whole family for two weights wastes hundreds of kilobytes.
- Self-host or preconnect fonts to reduce latency.
- Use
font-display: swapto display text immediately. - Remove unused CSS. CSS frameworks often generate 80% superfluous code.
Step 4: hosting and caching
Choose decent hosting
Shared hosting at 3 TND a month has a hidden cost: slowness. If your website shares an overloaded server with 300 other websites, no code optimisation will make up for it.
Enable caching
Caching avoids rebuilding each page at every visit. Depending on your technology:
- Static website — nothing to do, performance is built in.
- Dynamic CMS — enable page caching and browser caching.
- Always — set up a CDN if your audience is geographically spread out.
Enable compression
Gzip or Brotli compression reduces the weight of transferred files by 60 to 80%. It is a checkbox on most servers.
Step 5: the Core Web Vitals indicators
Google measures three main indicators:
| Indicator | What it measures | Target |
|---|---|---|
| LCP | Display time of the main content | under 2.5 s |
| INP | Responsiveness to interactions | under 200 ms |
| CLS | Visual stability of the page | under 0.1 |
LCP is mainly fixed through images and hosting. CLS, by setting the dimensions of images and blocks. INP, by reducing the JavaScript run at load time.
What brings the biggest gains, in order
If you need to prioritise, here is the order of cost-effectiveness observed on our projects:
- Optimise images — 2 to 3 seconds gained, low effort.
- Reduce third-party scripts — 1 to 2 seconds gained, medium effort.
- Improve hosting — 0.5 to 2 seconds gained, financial cost.
- Optimise fonts — 0.3 to 0.8 seconds gained, low effort.
- Enable compression and caching — 0.3 to 0.6 seconds gained, low effort.
When a redesign becomes the right option
Some slowness is structural. If your website:
- loads more than 30 third-party scripts,
- relies on outdated technology,
- piles up unnecessary plugins,
- scores below 40 on PageSpeed despite optimisation,
then optimisation will quickly reach its limits. Rebuilding on a modern foundation will cost less than treating the symptoms for years.
In short
Start by measuring, then tackle the images — it is the biggest gain for the least effort. Move on to scripts, then hosting. In most cases, these three areas are enough to turn a slow website into a fast one.
Would you rather delegate? We carry out complete performance audits with an action plan prioritised by impact.