Type something to search...
Website Performance Optimization Strategies: How Loading Speed ​​​​Affects Your Business

Website Performance Optimization Strategies: How Loading Speed ​​​​Affects Your Business

Butterfly effect with 1 second loading speed

The patience of not only Koreans, a “fast, quick” people, but also internet users around the world, is getting shorter and shorter. An Amazon study found that for every 100ms (0.1 second) of delay in website loading time, sales decrease by 1%. Google also announced that when page loading time increases from 1 second to 3 seconds, user bounce rate increases by 32%.

Modern web applications are becoming increasingly heavy-handed to provide fancy UI and complex functionality. No matter how great a feature a developer implements, it is of no use if the user presses the back button before viewing the screen. Web performance optimization goes beyond simple technical satisfaction and is one of the most important business indicators directly related to a company's sales.

In this post, we will look at key strategies to optimize website performance in the front-end area.

1. Image Optimization

Images take up the largest portion of a web page's capacity. Just processing images properly can dramatically improve perceived performance.

Use next-generation image formats

Use WebP or AVIF formats instead of traditional JPEG or PNG. You can dramatically reduce file size by 30% to as much as 50% while minimizing loss of image quality. HTML's <picture> tag allows you to branch out the format depending on browser support.

Lazy Loading

There is no need to download all images that are not visible on the user's current screen (viewport) at the time of page loading. Lazy loading is a technique that loads images by the time you scroll down and the image appears on the screen. In HTML5, this can be simply implemented by adding the loading="lazy" attribute to the <img> tag.

Proper image resizing

Retrieving a 3000x3000 pixel original image from the server for a thumbnail that will be displayed at 300x300 pixels on a mobile screen is a huge waste of bandwidth. You must provide an appropriately sized image for the device size.

2. Reduce resource capacity (Minify & Compress)

This is to reduce the size of text files (HTML, CSS, JavaScript) that the browser must download.

Compression

Reduce the file size by removing unnecessary spaces, line breaks, comments, etc. contained within the code, and by obfuscating variable names briefly. You can automate the build process through bundlers such as Webpack or Vite or plugins such as Terser.

Gzip/Brotli compressed transfer

When transferring a file through Nginx or Apache settings on the server side, it must be compressed using the Gzip or Brotli algorithm and sent to the client, and the browser must decompress it and enable it. Especially for text files, the compression efficiency is very good.

3. Remove rendering blocking resources

The browser draws the screen by parsing HTML from top to bottom, but when it encounters heavy JavaScript or CSS in the middle, it stops rendering until it is downloaded and executed. This is called ‘Rendering-Blocking’.

CSS goes to the bottom of <head>, JS goes to the bottom of <body>

To avoid flashing unstyled content (FOUC), CSS is declared inside <head> to ensure fast loading. On the other hand, JavaScript files that are not essential for initial rendering should be placed at the very bottom of the <body> tag, or should be downloaded asynchronously in the background by giving the defer or async attribute to the <script> tag.

4. Code Splitting

A chronic disadvantage of SPA (Single Page Application) is that all JavaScript code of the app must be downloaded upon initial loading (increasing the bundle size).

Code splitting is a technique that splits this huge bundle file into several smaller chunk files. You can significantly improve the initial loading speed (TTI, Time to Interactive) by loading only the code required for the route (page) that the user first enters, and dynamically loading (Dynamic Import) the code of other pages when the user moves to that page.

5. Utilizing caching strategy (Caching)

The fastest network request is to make no request at all.

Browser caching settings

Set Cache-Control appropriately in the server response header to ensure that static resources (images, fonts, CSS, JS bundles) that do not change are cached inside the browser for a long time. However, a cache invalidation strategy that adds a hash value to the file name must be used in parallel so that the browser can recognize the new file when the file contents change.

Introduction of CDN (Content Delivery Network)

Static files should be cached on an edge server physically close to the user to minimize transmission latency. The more global the service, the more essential the introduction of CDN is.

Conclusion: If you can't measure it, you can't improve it

The first step to performance optimization is accurately measuring the current state. Take advantage of great free tools like Lighthouse and PageSpeed ​​Insights provided by Google. While monitoring the Core Web Vitals indicators (LCP, FID, CLS) presented by these tools, try applying the techniques introduced above to your project one by one.

Related Post

The Complete Guide to Docker: Introduction to and Use of Container Technology for Beginners

The Complete Guide to Docker: Introduction to and Use of Container Technology for Beginners

What is Docker? One of the technologies that has brought about the most innovative changes in the software development and distribution environment in recent years is Docker. Docker is a software

Mastering Kubernetes: Container Orchestration Beyond Docker

Mastering Kubernetes: Container Orchestration Beyond Docker

What is Kubernetes? While Docker revolutionized the creation and management of single containers, Kubernetes (k8s for short) is a 'Container Orchestration' tool that automates the process of depl

The Complete Guide to Git Branching Strategy: From Git Flow to GitHub Flow

The Complete Guide to Git Branching Strategy: From Git Flow to GitHub Flow

A necessity for collaboration, Git branch strategy In software development projects, when multiple developers write code simultaneously, conflicts and confusion inevitably arise. “Who modified th

React vs Vue.js: Guide to Choosing a Front-End Framework in 2024

React vs Vue.js: Guide to Choosing a Front-End Framework in 2024

Front-end war, what is your choice? If you are at all interested in web development, you have probably heard the names 'React' and 'Vue.js' at least once. As the jQuery era comes to an end and th

Python Data Analysis Basics: Mastering Pandas Core Functions

Python Data Analysis Basics: Mastering Pandas Core Functions

Excel in the Python data ecosystem, Pandas Why was Python able to become the overwhelming number one language in the fields of data science and machine learning? This is thanks to an excellent ec

Complete CI/CD pipeline automation starting with GitHub Actions

Complete CI/CD pipeline automation starting with GitHub Actions

Escape the nightmare of manual deployment “Okay, now the coding is done! Let’s connect to the server, get git pull, reinstall dependencies, build, kill the existing process, and launch a new pr

TypeScript 101: Putting ‘seatbelts’ on JavaScript

TypeScript 101: Putting ‘seatbelts’ on JavaScript

Betrayal of JavaScript JavaScript is the most widely used language in the world, and is a very flexible and easy to write language. However, as the project size grows and becomes more complex, 'f

Practical guide to developer-prompted engineering in the era of generative AI

Practical guide to developer-prompted engineering in the era of generative AI

Introduction: Why do developers need prompt engineering? In an era where generative AI writes code and fixes bugs, the role of developers is rapidly evolving from simply ‘typing’ code to ‘designi

Front-end ecosystem trends in 2024: What should we learn and prepare for?

Front-end ecosystem trends in 2024: What should we learn and prepare for?

Introduction: The ever-changing front-end ecosystem Among the web development fields, the front-end ecosystem is one where the speed of change is dazzlingly fast. New frameworks and tools are con

2024 SEO (Search Engine Optimization) Key Strategies for Blog Monetization

2024 SEO (Search Engine Optimization) Key Strategies for Blog Monetization

Introduction: Why is it still SEO (Search Engine Optimization)? In an era where short-form content such as YouTube shorts and Instagram reels are the trend, some say, “The era of blogs is over.”

WebAssembly Innovation: Beyond the Browser to Cloud Native

WebAssembly Innovation: Beyond the Browser to Cloud Native

Introduction: WebAssembly breaks through the limits of browser performance The early web was designed simply for sharing documents, and JavaScript was used to add lightweight dynamic effects to t

Next.js 15+ Deep Dive: Server Component Optimization and Rendering Architecture Evolution

Next.js 15+ Deep Dive: Server Component Optimization and Rendering Architecture Evolution

Introduction: React’s philosophy changes, Next.js and App Router Although React's position in the web development ecosystem is strong, the paradigm of front-end architecture has been undergoing m

Generative Engine Optimization (GEO): The Next Evolution of SEO in the AI Era

Generative Engine Optimization (GEO): The Next Evolution of SEO in the AI Era

Introduction: The Shift from Traditional SEO to GEO For decades, Search Engine Optimization (SEO) has been the cornerstone of digital marketing. Marketers focused on keyword density, backlink pro