Move most of the work from the server to the client
The first thing you have to do to have a really fast web application is to choose the right architecture. Changing an application's architecture is a fairly fundamental decision. The moment your user clicks a button or a link, your server has a lot of work to do, while the browser waits and shows the user a spinning wheel. Change that. Let the server do only what is necessary, above all respond quickly, and use the computing power of the client. You will naturally speed up the response further because the server will only send pure data to the client and not whole generated pages. We call this architecture a thick client and a thin server.
Choose a good technology for developing the client
As mentioned above, a fast client is more complex than in a classic solution, but this is made up for by the simplicity of the server. Today there are two basic directions for building a client: Javascript and Webassembly. Both have their pros and cons. Javascript is slower, but search engines can process it. It is suitable especially for front-end applications such as service landing pages and e-shops. With Webassembly you can afford much more; it is suitable for real-time websites, games and above all all pages behind a login (which you certainly don't want indexed by search engines). Webassembly is a newer technology and doesn't suit computers with browsers more than ten years old. You can also have a hybrid solution, where the page has a Webassembly object such as a filter or an animation, but the page itself is a classic HTML page.
Choose a fast technology for the server
Here too there are two main directions: compiled and interpreted languages. Compiled languages, as the name suggests, need a compiler that creates an executable program from the source code. The running program then works faster and generally uses less memory. An interpreted language is the exact opposite. The interpreter reads the source code directly and executes it immediately. It has to work out from the text what to do (we call this part of a program a parser). It runs a program that generally needs processor time and memory, so it is somewhat more demanding and slower. But interpreted languages are simpler to program in, and development in them is cheaper. If we need to build a fast website, we have to choose a compiled language. Such languages include Java, C# and C++. When there is pressure on price or the project is simple, interpreted languages such as PHP or Javascript (NodeJS) are more suitable. I haven't yet mentioned a solution that has the advantages of both. Python is an interpreter, but it translates loaded source code into compiled code, which is automatically recompiled if the programmer changes something in the source. My personal opinion is that it suits small and medium-sized applications, because it is not as strictly typed as compiled languages. A quality server is essential for a fast web application.
Use a multithreaded approach
At a time when every computer has several processor cores, it is not hard to imagine that it can do several things at once. And what about waiting in parallel! What if a page "orders" 20 portions of some data and waits, say, 100 ms for each? If it does it the old way, serially, it waits at least 2 seconds. Parallel processing was added to browsers around 2019. Every PC with Windows 10, Linux, Android, OSX and iOS can do it. Parallel processing is needed on the server too. All compiled languages can do it, interpreted ones can't. Interpreted languages often use several workers (in fact complete servers), and the web server assigns one worker to one page. But workers don't work as well as threads. They have a bigger overhead.
Don't make your users wait unnecessarily
When many applications perform a demanding operation, they simply serve a page that takes half a minute to load, and the user just stares at a spinning wheel. Do it better. Start the operation, immediately tell the user so that they can keep working, and then let them know when the long operation is done.
Use "psychological tricks" that make it feel even faster than it really is
Webassembly applications also produce, almost by accident, effects that people perceive positively. For example, when the user clicks something and you "order" data from the server, you can show the user an empty page without data in the meantime. This keeps the user busy for a few tens of milliseconds while the data loads. Because the user is already looking at the screen and watching what has changed, loading seems faster to them. In addition, combo boxes appearing gradually as data arrives for the lookup tables is in fact a kind of animation for them. That keeps them busy for a little while too.
Don't support historical browser versions
All of the above won't run in Internet Explorer or in some historical version of a web browser installed somewhere on Windows XP. This limitation doesn't bother me. I make software for professional work, and it is reasonable to assume that my customers have Windows 10. Windows 7 and XP are used by less than one percent of people. It is worth considering whether to build software "the old way" because of this minority, or to make a separate version just for them.
In conclusion
Choosing the right technology has an absolutely fundamental effect on an application. Interpreted languages are suitable for simpler applications. But if you have more work on the server, definitely choose compiled languages. If possible, try to avoid compatibility with old PCs. The decision, however, depends on the specific needs of your application.
