2005since
year

Hosting & Security

Server Speed and Time to First Byte (TTFB): How Hosting and Caching Make Your Website Faster

Website speed isn’t only about images and design; a large part of it starts at the server. We explain Time to First Byte (TTFB), the layers of caching (page, object, browser, network), important server settings such as PHP version, HTTP/2, HTTP/3 and compression, and how to measure and diagnose before buying a more powerful server.

  • 16 Nov 2026published
  • 6min read
  • Nov 2026updated
Key takeaways
  • TTFB is the time until the server starts responding, and it affects every speed metric after it.
  • Page caching turns dynamic pages into ready files served instantly.
  • Object caching (such as Redis) speeds up parts that can’t be stored as whole pages, like stores.
  • A recent PHP version and an optimised database make a noticeable difference at no cost.
  • Diagnose before you upgrade; much slowness comes from heavy plugins or queries, not the server.

A company compressed its website images, removed unused plugins and minified its CSS and JavaScript — yet the site still takes two or three seconds before anything appears on screen. The cause wasn’t the page itself but what happens before it: the server takes a long time to start responding. In the world of performance this time has a name: TTFB, or Time to First Byte.

In website speed and Core Web Vitals we discussed speed from the page side. Here we focus on the other side: the server, caching and the settings we configure in our hosting service.

What is TTFB?

When a visitor types your website address, a chain of steps happens: looking up the server’s address through DNS, opening a secure connection, sending the request, and then the browser waits until the first part of the response arrives. That whole wait is the TTFB. During it, the server is busy running the site’s code, querying the database and building the page. Everything that happens afterwards (loading images, rendering the page) only starts once this time is over. So a high TTFB slows everything down, and it affects the Largest Contentful Paint (LCP) metric Google measures.

What raises TTFB?

CauseFix
Hosting with weak or congested resourcesDedicated resources or optimised managed hosting. Read hosting types
No page cachingPage caching at the server or plugin level
Heavy database queriesObject caching, table optimisation, removing heavy plugins
An old PHP versionUpgrade to a recent supported version after compatibility testing
The server is far from the visitorA server close to the audience and a content delivery network
Slow DNSA fast DNS provider
Multiple redirectsReduce redirects (such as http to https, then to www)
Plugins calling external services on every requestCache the results or replace the plugin

Layers of caching: from closest to the visitor to furthest

Caching simply means: don’t rebuild what you’ve already built. Several layers work together:

1. Browser cache

Instructions the server sends to the browser to keep static files (images, fonts, CSS, JavaScript) for a period, so they aren’t downloaded again on every visit. It speeds up repeat visits a lot.

2. Content delivery network (CDN)

Geographically distributed servers that keep copies of your static files, and sometimes whole pages, and serve them from the point closest to the visitor. Very useful if your audience is in Saudi Arabia, Egypt and other countries. Read CDN and protection.

3. Page cache

Instead of WordPress running code and querying the database for every visitor, the finished page is saved as a ready file and sent immediately. This alone can cut TTFB significantly on brochure sites and blogs. Personal pages such as the cart, checkout and account must be excluded.

4. Object cache

In stores and dynamic sites, not every page can be cached whole. This is where object caching (such as Redis or Memcached) comes in, keeping the results of repeated queries in memory and speeding up the dashboard, personal pages and search.

5. Code cache (OPcache)

Keeps a compiled copy of PHP code in memory, so it isn’t re-parsed with every request. It’s enabled at the server level.

Server settings that make a difference

  • A recent, supported PHP version: newer versions are faster and more secure. Check the officially supported versions list and test the site’s compatibility before upgrading.
  • HTTP/2 and HTTP/3: protocols that load multiple files efficiently over one connection.
  • Brotli or Gzip compression: reduces the size of text sent.
  • Modern TLS: a secure connection with a faster handshake.
  • NVMe drives: faster reads and writes for the database and files.
  • Database tuning: enough memory, suitable indexes, and clearing tables of transients and old revisions.
  • Automatic conversion of images to modern formats: such as WebP and AVIF, with multiple sizes for different devices.

Diagnose before you upgrade

The most expensive mistake is buying a more powerful server to solve a problem caused by a heavy plugin or a bad query. Before upgrading:

  1. Measure TTFB with tools such as PageSpeed Insights and from several locations.
  2. Compare a cached page with an uncached one: if the difference is large, caching works and the problem is page generation.
  3. Use WordPress query monitoring tools to find the slowest plugins and queries.
  4. Disable suspect plugins on a staging site and measure the difference.
  5. Review server resource usage: if it’s near its limit all the time, an upgrade is justified.

Stores: a special case

Online stores are harder to speed up, because many of their pages are personal (cart, account, checkout) and can’t be cached whole. Here object caching, an optimised database, sufficient resources and fewer plugins matter more than anything. Before promotional seasons, prepare the server in advance to handle the load, and load-test before the campaign, not during it. Read reducing cart abandonment — slowness on the checkout page is one of its biggest causes.

Caching and changing content

A common question after enabling caching: “I edited the page but the change doesn’t show!”. The reason is that visitors see the cached copy. The fix isn’t disabling the cache, but configuring it to clear automatically when content is updated: when an article is published, a page edited or a product price changed, only the cached copy of that page and its related pages is purged. Good caching tools and managed hosts provide this, and it should include purging the CDN cache too. When the design or CSS files change, version numbers are used in the file links so the browser fetches the new version immediately instead of the old one it has stored. This balance keeps the site fast and up to date at the same time. Document your caching settings in a clear file so any later developer knows what is cached, what is excluded and why, and nobody disables the cache by mistake during a later change.

How do you measure the result?

ToolWhat it measures
PageSpeed InsightsReal-user data (where available) and lab analysis, including TTFB and LCP
Search Console — Core Web Vitals reportHow your pages perform for real visitors
Browser developer toolsThe details and timing of every request
Uptime monitoringResponse time over time. Read monitoring

An illustrative example: three steps before any upgrade

A service company’s WordPress site has a high time to first byte on every page. Step one: enable server-level page caching, which cuts the time dramatically on public pages, though the dashboard and request forms stay slow. Step two: inspecting the queries reveals an old statistics plugin writing to the database on every visit, so it’s replaced with an external analytics tool and the bloated tables are cleaned. Step three: upgrade PHP to a recent supported version after testing it on staging, and enable object caching. The result: a clearly faster site on the same server, with no additional hosting cost. An upgrade becomes justified only if resources remain exhausted after these steps.

From our work: image-rich sites such as Egiptari Tours and Al Ahram Decor, and stores such as Bnood, need special care with caching, modern image formats and server settings, because their visitors judge quality by how fast the first image appears.

The bottom line

Website speed starts at the server: a low TTFB thanks to suitable resources, layered caching, a recent PHP version, modern protocols, a clean database and a content delivery network. Diagnose first, then optimise, then upgrade if needed. We configure all of this within our hosting service. Get in touch for a check of your site’s speed.

FAQ

What is a good TTFB?

web.dev guidance suggests a good time to first byte is generally around 0.8 seconds or less. The lower the better, especially for visitors far from the server.

Can caching cause problems?

It can if misconfigured, such as showing one user’s cart to another. That’s why personal pages (cart, checkout, account) are excluded from page caching and carefully designed rules are used.

Do I need a CDN if my server is in the same country as my audience?

A CDN helps even then, by taking load off the server, speeding up static files and providing protection — and it helps more if your audience is spread across several countries.

Creative Agency
The Creative Agency team

Written from 20+ years designing websites and identities for clients in Saudi Arabia and Egypt — every tip here comes from real projects.

Want this applied to your project?

Book a free consultation — we will review your site or brand and propose a clear plan.

Book a free consultation

Get your free consultation now!