Introduction to Web Performance Optimisation Techniques


Ever clicked on a website, only to stare at a blank screen for what feels like forever? Or tried to navigate a page that takes ages to respond to your clicks? These frustrating experiences are often the result of poor web performance. In today’s fast-paced digital world, users expect websites to load quickly and run smoothly. If a site is slow or unresponsive, they’re likely to leave and never return.
This is where web performance optimisation comes in. By adopting the right techniques, developers can ensure their applications are fast, efficient, and user-friendly. In this article, we’ll explore key optimisation strategies, including Minification, Code Splitting, Tree Shaking, Asset Optimisation, Caching, Content Delivery Networks (CDNs), Reducing HTTP Requests, Critical Rendering Path Optimisation, etc. We’ll also discuss common performance bottlenecks, how performance impacts web applications, and how to measure performance effectively.
Common Performance Bottlenecks
Before diving into optimisation techniques, it’s important to understand the key areas where performance issues often arise. These bottlenecks can slow down websites, frustrate users, and even hurt businesses. Let’s take a closer look at the most common culprits:
Large JavaScript Bundles:
What Happens: When a website relies on large JavaScript files, the browser takes longer to download and execute them.
Impact: This delays the time it takes for a page to become interactive, especially on slower networks or devices.
Unoptimised Assets:
What Happens: Large images, fonts, and videos can significantly slow down a website.
Impact: For instance, a high-resolution image that hasn’t been compressed can take several seconds to load, making the site feel sluggish and unresponsive.
Render-blocking Resources:
What Happens: CSS and JavaScript files that block the rendering of a page can delay the display of content.
Impact: Users might see a blank screen for several seconds before anything appears, leading to a poor first impression.
Inefficient Network Requests:
What Happens: If a website makes too many HTTP requests or sends uncompressed data, it can slow down page loading.
Impact: Each request adds overhead, and uncompressed files take longer to download, increasing overall load times.
Lack of Caching:
What Happens: Without proper caching, browsers and servers have to re-download the same assets every time a user visits the site.
Impact: This wastes bandwidth and increases load times, especially for returning visitors.
How Performance Impacts Web Applications
Now that we’ve identified the bottlenecks, let’s explore how they impact web applications in terms of user experience, SEO, and business revenue.
User Experience (UX):
A fast-loading website is crucial for keeping users engaged. According to this research by Google, when page load time rises from 1 second to 3 seconds, bounce probability increases by 32%. This escalates to 90% at 5 seconds and peaks at 123% by 10 seconds. Slow performance directly frustrates users, leading to higher abandonment rates and lower engagement.
Search Engine Optimisation (SEO):
Search engines like Google prioritise fast-loading websites. Key ranking factors include Google’s Core Web Vitals metrics like Largest Contentful Paint (LCP), Interaction to Next Paint (INP), and Cumulative Layout Shift (CLS). Websites that load in under 2.5 seconds tend to rank higher in search results, increasing organic traffic.
Business and Revenue:
Web performance is a critical driver of revenue and customer loyalty in the digital age. Recent studies highlight the stark financial impact of delays:
Pinterest in 2016 boosted sign-ups by 15% by reducing perceived load time by 40%.
Portent’s 2022 analysis reveals sites loading in 1 second achieve 2.5x higher conversions than those taking 5 seconds.
Rakuten streamlined its mobile experience, reducing page load time by 40%, which boosted conversions by 15%.
Vodafone improved Core Web Vitals, cutting Largest Contentful Paint (LCP) by 31% and increasing sales by 8%.
redBus optimised Interaction to Next Paint (INP) by 75%, reducing checkout latency and increasing bookings by 13%.
How is Web Performance Measured?
To address these bottlenecks, it’s essential to measure performance effectively. Web performance is measured using a combination of metrics, tools, and real-user data. These measurements help identify bottlenecks, track improvements, and ensure applications meet user expectations.
Key Performance Metrics
Performance metrics provide quantifiable data about how a website or application behaves. Some of the most important metrics include:
Largest Contentful Paint (LCP):
Measures how long it takes for the largest content element (e.g., an image or text block) to load.
Goal: Less than 2.5 seconds.
Interaction to Next Paint (INP):
Measures how quickly a page responds to user actions (e.g., clicks or taps).
Goal: Less than 200 milliseconds.
Cumulative Layout Shift (CLS):
Measures how much the page layout shifts during loading, which can cause elements to move unexpectedly.
Goal: Less than 0.1 score.
-
Measures time until the first text, image, or other content appears on the screen.
Goal: Less than 1.8 seconds.
-
Measures how long it takes for the browser to receive the first byte of data from the server.
Goal: 0.8 seconds or less.
Real-World Data vs. Lab Data
Lab Data: Collected in a controlled environment using tools like Lighthouse or PageSpeed Insights. Useful for identifying potential issues during development.
Real-World Data: Collected from actual users using Real User Monitoring (RUM) tools. Provides insights into how real users experience the site under different conditions.
Tools for Measuring Performance
Here’s a table of popular tools for measuring web performance:
Tool | Purpose | Key metrics |
Lighthouse | Lab-based audits for performance, SEO, and accessibility. | LCP, INP, CLS. |
PageSpeed Insights | Combines lab and field data (CrUX) to analyse performance. | LCP, INP, CLS, TTFB. |
Web Vitals Extension | Real-time Core Web Vitals measurement. | LCP, INP, CLS. |
GTmetrix | Lab testing with waterfall analysis. | TTFB, Load time, page size. |
Google Analytics | Tracks real-user metrics (RUM). | Page load time, bounce rate, engagement. |
WebPageTest | Advanced lab testing for global performance analysis. | Speed Index, FCP, video rendering analysis. |
Chrome DevTools | Web performance profiling. | LCP, INP, CLS. |
Techniques to Optimise Web Performance
Now that we’ve identified the bottlenecks and how to measure performance, let’s explore the strategies to optimise web performance.
Frontend Optimisations
These techniques focus on optimising how the browser loads and renders content.
Minification
Code Splitting
Splits code into smaller chunks loaded on demand (e.g., per route or feature).
Impact: Reduces initial bundle size, speeding up first-page loads.
Tools: Webpack, Vite, React.lazy.
Tree Shaking
Asset Optimisation
Compresses images (WebP/AVIF), fonts (subsetting), and videos (modern codecs).
Impact: Reduces media file sizes by up to 80% without quality loss.
Tools: ImageOptim, Squoosh, FFmpeg.
Reducing HTTP Requests
Impact: Minimises network round trips, improving load times.
Methods: Combine CSS/JS files, use sprites for images, inline critical CSS, and reduce unnecessary third-party scripts.
Critical Rendering Path Optimisation
Prioritises loading styles/scripts needed for above-the-fold content.
Impact: Reduces render-blocking resources, improving First Contentful Paint (FCP) and Interaction to Next Paint (INP).
Methods:
async
/defer
scripts, inline critical CSS, preload key assets.
Web Workers
Impact: Enhances page responsiveness by offloading CPU-intensive tasks, improving smoothness in animations and interactions.
Tools: Native Web Workers API.
Server-Side Optimisations
These techniques enhance performance by optimising how content is served and delivered.
Caching
Stores resources locally (browser) or on CDNs to avoid re-fetching.
Impact: Reduces server requests and improves repeat visit load times.
Tools:
Cache-Control
headers, Service Workers, Redis.
Content Delivery Network (CDN)
Serves assets from geographically distributed servers.
Impact: Improves page load times, reduces latency, and enhances global accessibility.
Tools: Cloudflare, AWS CloudFront, Fastly.
Server-Side Rendering Strategies (SSR & SSG)
SSR: Generates HTML on the server per request, reducing client-side processing and improving initial load times.
SSG: Pre-renders pages at build time, serving static files instantly for ultra-fast performance.
Impact: Improves page load speeds, enhances SEO, and optimizes content delivery based on the application’s needs.
Tools: Next.js, Nuxt.js, Gatsby, Hugo.
Conclusion
Optimising web performance is not just a technical necessity, it’s a business imperative. By addressing common bottlenecks such as large JavaScript bundles, unoptimised assets, and inefficient network requests, developers can create faster, more efficient websites that keep users engaged.
A well-optimised site not only enhances user experience but also improves SEO rankings, reduces bounce rates, and ultimately drives higher conversions and revenue. In today’s competitive digital landscape, performance optimisation is a key differentiator that no business can afford to ignore.
Subscribe to my newsletter
Read articles from MyCodingNotebook directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

MyCodingNotebook
MyCodingNotebook
MyCodingNotebook is every developer’s online notebook—a space to explore coding concepts, share insights, and learn best practices. Whether you're just starting or an experienced developer, this blog serves as a go-to resource for coding best practices, real-world solutions, and continuous learning. Covering topics from foundational programming principles to advanced software engineering techniques, MyCodingNotebook helps you navigate your coding journey with clarity and confidence. Stay inspired, keep learning, and continue growing in your coding journey.