Skip to content

Software Development· 8 min read

How to Improve Web Application Performance

Improve web application performance by measuring the slow part first: database, payload, JavaScript and third-party calls — then changing that part.

By Muhammad Luqman, Founder, Web3NextAIPublished

Web application performance improves when you spend effort on the thing that is actually slow. Teams instead add a cache, a CDN and a new framework, and the page is still waiting on one query. Measure the wait. Then change the largest slice of it.

Split the wait before you optimise

Browser developer tools and a server timing header are enough to start. A performance budget is a sentence: this page’s main request stays under a limit you chose, on a connection you named. Without the sentence, “faster” has no finish line.

Where time usually goes
SliceHow you noticeTypical first fix
Server and databaseThe document or API takes seconds before the browser can paint.The query plan, an N+1, a missing index, an unbounded list.
PayloadThe response is fast to generate and large to download.Send the fields the screen needs. Paginate.
Client JavaScriptThe network is done and the main thread is busy.Less code on the first view. Defer what the first task does not need.
WaterfallMany small requests run one after another.One request for the view, or parallel requests that do not depend on each other.
Third partiesA tag, a font or a widget blocks the page.Load it after the task, or do not load it on that page.

Backend and database first, when they dominate

An N+1 query — one query for the list, then one per row — is the most common reason a page dies at a few hundred records. Fix it with a join or a batched read, then look at the plan. Indexing a column you do not filter on does nothing. Database work and performance debugging overlap here: the “bug” is time.

Frontend performance without a rewrite

Images with dimensions and a modern format, fonts that do not block text, and JavaScript that is not all loaded for a marketing header. In React and Next.js, the expensive mistakes are shipping a large client bundle for a page that could have been rendered on the server, and refetching on every interaction because the cache key is wrong. React versus Next.js is relevant because the framework decides where that work runs.

Do not micro-optimise a component while the API takes two seconds. The measurement tells you which paragraph of this article to follow.

Caching is a product decision

A cache hides staleness. That is acceptable for a public article and dangerous for a balance or a booking. Decide the maximum age before you add the cache, and decide how a write invalidates it. A cache without an invalidation story is a future bug with a speed improvement in front of it.

Key takeaways

  • 01Measure which slice dominates. Change that slice.
  • 02N+1 queries and huge payloads beat clever frontend work as a first suspect.
  • 03Cache only data that is allowed to be stale, and say for how long.

Frequently asked questions

Will a CDN fix a slow app?

It fixes distance for static files. It does not fix a slow database or a waterfall of authenticated API calls.

How fast is fast enough?

Fast enough that the task feels immediate on a ordinary laptop and a ordinary connection. Set a number for the main request and keep it. Chasing a perfect lab score while the query is unbounded is the wrong project.

About the author

Muhammad Luqman

Founder, Web3NextAI

Muhammad Luqman is the founder of Web3NextAI (WNAI), a software development company. He has designed and shipped production platforms across healthcare, SaaS, e-commerce and Web3, and writes about the engineering decisions behind software that actually runs a business.

Related services and industries

All insights

Next steps

Want this applied to a real project?

Describe the product, the defect or the decision. We reply with questions and a suggested direction.

Start a Project Explore Our Work

Every inquiry is carefully reviewed by our team.

Working with companies across Europe, the Gulf, North America and Asia-Pacific — remotely, in English, in overlapping hours.