Web performance optimization is the work of making a site or web app load quickly, respond instantly and stay visually stable. The reliable order is: measure real user data first, fix the server response and the largest above-the-fold assets, then add caching, and keep monitoring so gains do not erode. This guide walks through that order, with targets, tools and a caching section that covers invalidation.
TL;DR
- Define the goal in measurable terms. Google's targets are LCP within 2.5 seconds, INP under 200 milliseconds and CLS under 0.1.
- Start with server response (TTFB), then images and critical resources, then JavaScript. That order usually pays back fastest.
- Cache in layers (browser, CDN, server, database) and plan invalidation before you set long lifetimes.
- Report percentiles (p75, p95, p99), not averages, and set a performance budget so regressions fail the build.
- Beyond page load, tune runtime behavior, queries and background work, and monitor continuously.
Table of Contents
- What web performance optimization covers
- Why speed is a business metric
- Step 1: Measure before you change anything
- Step 2: Fix the server response first
- Step 3: Optimize images and the critical path
- Step 4: Keep JavaScript under control
- Web caching strategies and cache invalidation
- Beyond page load: application performance tuning
- Monitor continuously so gains last
- A realistic order of work
- Get a faster product with Requestum
- FAQ
- Sources
What web performance optimization covers
MDN defines web performance as how long a site takes to load, become interactive and responsive, and how smooth its content feels during interactions. That definition has two halves worth separating:
- Load performance: the initial request, network transfers, parsing and rendering until the user sees something useful.
- Runtime performance: how fast the browser paints pixels and how quickly the page reacts to clicks, taps and typing after it has loaded.
MDN's own guidance on monitoring and optimizing website performance draws the same line and recommends continuous monitoring to catch regressions and track trends. Most "slow app" complaints turn out to belong to one half or the other, and the fixes differ, so diagnose before you act.
Why speed is a business metric
Speed is easy to treat as an engineering vanity project. The evidence says otherwise. web.dev's overview of why speed matters reports that the BBC lost an additional 10% of users for every extra second its site took to load, and that Rakuten 24's investment in Core Web Vitals raised revenue per visitor by 53.37% and conversion rate by 33.13%. Those are single-company results, not guarantees, but they show the shape of the upside.
Cloudflare's learning center adds that site speed affects conversion rate, bounce rate, search rankings and user experience. If you need to make the case internally, MDN's business case for performance suggests tying work to KPIs such as conversion rate, time on site and Net Promoter Score. If search visibility is part of your reasoning, this walkthrough on how faster speed supports SEO and conversions connects the two.
Step 1: Measure before you change anything
Optimizing without a baseline produces busywork. Pick a small set of metrics, collect them from real users and from a controlled lab, and agree on targets.
The metrics that matter
| Metric | What it tells you | Good target |
|---|---|---|
| LCP (Largest Contentful Paint) | How fast the main content appears | 2.5 s or less |
| INP (Interaction to Next Paint) | How quickly the page responds to input | Under 200 ms |
| CLS (Cumulative Layout Shift) | How much the layout jumps around | Under 0.1 |
| TTFB (Time to First Byte) | How quickly the server starts answering | 0.8 s or less |
The first three come from Google's Core Web Vitals guidance. For TTFB, PageSpeed Insights rates 800 ms or less as good and anything above 1.8 seconds as poor. web.dev calls TTFB a foundational metric because it precedes every other user experience metric: a slow first byte delays everything after it.
Use percentiles, not averages
An average hides your unhappiest users. Microsoft's Azure Well-Architected guidance recommends measuring latency and load times with percentiles such as p50, p95 and p99, because averages mask the experience of a few extremely slow requests. Read p50 as typical, p95 as what most users see under load, and p99 as your worst cases. For Core Web Vitals, assessment is done at the 75th percentile and segmented by mobile and desktop, as DeviQA summarizes.
Pick a balanced set of metrics
The U.S. Web Design System advises choosing at least one primary direct metric and one primary indirect metric, and tracking at least three in total. Its defaults are Speed Index, custom timing events and page weight. Custom timing events deserve attention: they let you measure the moments that matter to your product, such as "search results rendered" or "checkout button usable", rather than only generic browser milestones.
Tools for lab and field data
web.dev's performance audit tools article names Lighthouse, WebPagetest and PageSpeed Insights as useful for analyzing speed, data cost and resource usage. A companion piece on speed tools explains the split that matters: lab tools give controlled, repeatable comparisons, while field data shows what real visitors on real devices experienced. Use both. Lab results tell you why something is slow; field data tells you whether anyone is affected.

Step 2: Fix the server response first
Because TTFB gates everything else, start at the network edge. One practical sequence, described by Frontend Performance Guide, is:
- Remove redirects on key entry URLs. Dropping a redirect removes a full round trip, often 100 to 300 ms on mobile, according to the same guide.
- Cache HTML at the CDN where the page is not personalized.
- Enable Brotli for every text response.
- Enable HTTP/3 and TLS 1.3 at the CDN.
- Stream or flush early on uncached responses.
- Add speculation rules for common navigation paths.
On compression, web.dev notes that Brotli improves on gzip by about 15% to 20%, and that a CDN can significantly improve TTFB in some cases. If your TTFB is still high after these steps, the problem is probably behind the CDN: slow queries, chatty service calls or a cold serverless function. We return to that in the application section below.
Step 3: Optimize images and the critical path
Images are often the heaviest assets and the most common LCP element, so they are a high-return target.
- Use modern formats and responsive sizes. Chrome for Developers recommends AVIF and WebP, served with srcset and sizes so browsers never download an image larger than it will be displayed.
- Prioritize the LCP image. Preload it and mark it high priority rather than letting it wait behind scripts.
- Lazy-load what is off screen. MDN's best practices include lazy loading parts of the application outside the viewport.
- Reserve space. Set width and height (or aspect ratio) on images, embeds and ad slots so content does not shift, which protects your CLS score.
Then look at the critical rendering path, the chain of resources the browser must fetch before it can paint. Chrome advises avoiding chained critical requests: minimize the number of critical resources, reduce critical bytes and order loading so the path is short. A stylesheet that imports another stylesheet that references a font is a three-step chain the user waits through.
Step 4: Keep JavaScript under control
JavaScript is where load problems become responsiveness problems. MDN's guidance is to keep JavaScript to a minimum, compress resources, use resource hints and rely on HTTP/2 and a CDN. In practice that means:
- Audit bundles and remove unused dependencies.
- Split code by route so a visitor downloads only what the page needs.
- Defer non-critical scripts, including third-party tags that marketing has added over the years.
- Break long tasks into smaller chunks so the main thread can respond to input, which is what INP rewards.
A performance budget keeps these gains. MDN explains that a budget is a set of limits such as maximum HTTP requests, total asset size or minimum frame rate that helps prevent regressions. Wire it into continuous integration so a pull request that adds 300 KB of script is flagged before it ships.
Web caching strategies and cache invalidation
Caching is the cheapest speedup you can buy, and the most common source of "why am I seeing old content?" tickets. Google's hosting guide for content-driven apps lists browser caching, server-side caching (Redis, Memcached, reverse proxies), CDN caching, database query caching and service worker caching as complementary layers. Each layer needs its own freshness plan.
The layers at a glance
| Layer | What it stores | Typical freshness tool |
|---|---|---|
| Browser | Static files, API responses | Cache-Control headers, versioned URLs |
| CDN / edge | HTML, assets, cacheable API calls | s-maxage, purge by URL or tag |
| Server-side (Redis, Memcached) | Computed fragments, sessions, query results | TTLs, explicit deletes on write |
| Database query cache | Repeated query results | Invalidation on table change |
| Service worker | App shell and offline data | Versioned caches, update on activation |
Four invalidation strategies that work
1. Fingerprint static assets. Put a content hash in the file name (app.3f9c2a.js) and serve it with a very long lifetime. When the file changes, the name changes, so there is nothing to invalidate. The immutable directive tells browsers not to revalidate during the lifetime, as the Cache-Control reference explains.
2. Use short lifetimes for HTML, with revalidation. web.dev suggests a five-minute cache lifetime for static HTML as a safe bet. Pair it with validators so a stale copy costs a small conditional request instead of a full download. The stale-while-revalidate directive lets caches serve a slightly old copy instantly while fetching a fresh one in the background, which hides origin latency from the visitor.
3. Purge on publish. For content that changes at unpredictable moments, such as a product price or an article, trigger a CDN purge from your publishing or deploy workflow. Purging by tag or key is safer than purging everything, which sends a spike of cold requests to your origin.
4. Invalidate on write in application caches. When code updates a record, delete or rewrite the cached entries derived from it in the same code path, and keep a TTL as a safety net in case a path is missed. Keep cache keys predictable so you can find every entry that depends on a record.
One older rule still applies. Steve Souders' 14 prioritized frontend rules include adding an Expires header, configuring ETags and making Ajax responses cacheable. The tools have moved on, but the habit of treating every response as a caching decision has not.
Avoiding stampedes
When a popular entry expires, many requests may hit your database at once. Reduce the risk by adding jitter to TTLs, allowing one request to rebuild the entry while others get the stale copy, and warming critical entries after a deploy.

Beyond page load: application performance tuning
Once the front end is healthy, the remaining slowness usually sits in the application and data layers. To improve application performance in a systematic way:
- Trace a slow request end to end. Distributed tracing shows whether time goes to the database, an upstream API or your own code.
- Fix the query before scaling the server. Missing indexes and fragmented indexes force extra I/O; Microsoft documents how index fragmentation and low page density degrade query performance in SQL Server, and the principle of checking query plans applies broadly.
- Move slow work out of the request. Email, report generation and image processing belong in queues.
- Right-size the architecture. Chatty microservices and oversized synchronous chains add latency; our notes on web application architecture checks and serverless trade-offs cover where those costs hide.
- Watch mobile separately. App performance on a mid-range phone with a weak connection is a different problem from desktop. Regular upkeep, such as the fixes in our mobile app maintenance guide, keeps it from drifting.
Speed also costs money on the infrastructure side, so pair tuning with a look at cloud cost optimization. Faster code often means fewer servers.
Monitor continuously so gains last
Performance decays. A new marketing script, a heavier hero image or a feature flag can undo a month of work. Set up:
- Real user monitoring for Core Web Vitals, segmented by device and country.
- Synthetic tests on your key journeys (home, search, checkout, login) on a schedule.
- Alerts on p95 and p99 latency, not only on averages.
- A budget check in CI.
If you have not formalized alerting yet, our guide to application monitoring best practices is a good starting point. For the SEO side of Core Web Vitals at the 75th percentile, this piece on page speed and SEO for dev teams explains how the numbers feed into search reporting. Finally, a slow-feeling interface is sometimes a design issue rather than a code issue, which is where a UI/UX audit checklist helps you prioritize.
A realistic order of work
For a team starting from scratch, this sequence balances effort against payoff:
- Capture a baseline: field Core Web Vitals plus a lab run on key pages.
- Fix redirects, enable compression and put a CDN in front of cacheable pages.
- Convert and resize the largest images; preload the LCP image.
- Trim and defer JavaScript; split bundles by route.
- Add layered caching with an invalidation plan for each layer.
- Profile the backend for slow queries and move slow jobs to queues.
- Set budgets and alerts, then review monthly.
Vendor-reported improvement ranges vary widely by site, so treat them as hypotheses to confirm against your own numbers rather than promises.
Our perspective
In our experience building web platforms, performance problems are rarely a single bad setting. They are usually the sum of decisions made early: how data is modeled, where state lives, how the front end is split and what gets measured. That is why we think performance belongs in the discovery and architecture stage, not in a cleanup sprint before launch.
Our approach combines business analysis, engineering and QA. Analysts define which user journeys must be fast, developers build with budgets in mind, and testers verify behavior under realistic load. When teams also bring in data science or AI, for example for demand-aware caching or smarter routing of heavy workloads, the same discipline applies: measure first, then change.
We would rather ship a product that is steady at p95 than one that looks excellent in a demo and struggles with real traffic.
Dmitry
Get a faster product with Requestum
If your web app or platform is slow and you need a team to find out why, our web development services cover custom web applications, CRM and ERP systems, eCommerce and marketplaces, built with performance in mind from the start.

We also provide software testing and quality assurance to verify behavior under load, and automation testing so regressions are caught before release. To scope the work, a discovery phase with our team is the place to begin; reach us through our services page.
FAQ
What is a good page load time?
Aim for an LCP of 2.5 seconds or less and a TTFB of 0.8 seconds or less, measured at the 75th percentile of real users. These are Google's guidance for Core Web Vitals and PageSpeed Insights thresholds. Check mobile and desktop separately, since they often differ.
Which should I fix first: images, JavaScript or the server?
Start with the server response, because every other metric waits on the first byte. Then deal with the largest images, which usually drive LCP, and then reduce and defer JavaScript to improve responsiveness. Your own field data should confirm the order for your site.
How do I keep cached content fresh?
Use fingerprinted file names for static assets, short lifetimes with revalidation for HTML, targeted CDN purges when content is published, and delete-on-write for application caches. Keep a TTL as a backstop in every layer so a missed invalidation corrects itself.
Why use p95 and p99 instead of the average?
Averages hide slow outliers. Microsoft's guidance explains that percentiles expose tail behavior: p95 shows what most users experience under load and p99 shows the worst cases.
Sources
- Web performance, MDN
- Monitoring and optimizing website performance, MDN
- The business case for web performance, MDN
- Web performance best practices, MDN
- Why does speed matter?, web.dev
- General HTML performance considerations, web.dev
- Optimize Time to First Byte, web.dev
- Use tools to measure performance, web.dev
- How to think about speed tools, web.dev
- Why does site speed matter?, Cloudflare
- Understanding Core Web Vitals and Google search results
- About PageSpeed Insights, Google for Developers
- Hosting optimizations for content-driven web apps, Google
- How to track performance, U.S. Web Design System
- Monitoring workload performance, Microsoft Azure Well-Architected Framework
- Maintain indexes optimally, Microsoft SQL Server
- Image delivery, Chrome for Developers
- Network dependency tree, Chrome for Developers
- High-Performance Web Sites, Communications of the ACM
- Web application performance testing, DeviQA
- Network and server response optimization, Frontend Performance Guide
- Cache-Control reference, http.dev
- Boost SEO and conversions with faster website speed
- 75th percentile Core Web Vitals: page speed SEO
