Not long ago we had a major change in the Alloq platform: we turned it into a one-page application! That sounds pretty good, but how does it make Alloq better?
A what now?
When you visit a website, such as alloq.nl, your browser asks the web server to send the document corresponding to that URL. The file being returned contains the content of that page. It also contains links to other pages that allow you to navigate between pages by clicking on them. When you click on a link, the browser navigates to a different URL, asks the web server for a new document and finally shows it to you.
This is how the Internet has worked since its inception in 1990. The web and browser have been significantly upgraded since the 1990s, but the principle of downloading a document for each page has not changed. That is, to one-page apps.
In its simplest form, a single-page app (SPA) is a web application that fits on one page. In other words, the browser downloads one document and does not have to download a completely new document when you navigate to another page. Instead, the SPA can decide if it needs new information and download only that information. Since the loading logic is now in the browser, SPAs are often built with frameworks to handle the added complexity.
Now that you know what SPAs are, let’s move on and look at their benefits!
1. Wait less
The biggest advantage of a SPA is that you spend less time waiting. If you compare the document from different pages, you will see a lot of overlap. If you look at just two different pages from any site, you will see that the header, footer, and often sidebars are identical. That means that every time the browser downloads a page, it loads a lot of information it had before.
A (properly configured) SPA will overcome this by preventing the same information from being downloaded twice again and only loading new relevant information. And download less means less waiting for the downloads to complete!
2. A seamless experience
Traditional web pages require the browser to swap the old page for the new one. This usually happens when the download of the new document is complete. Even if you navigate to a page you just visited, the entire file will still be loaded.
SPAs allow you to navigate directly to another page. If more data is needed, you will see a charging indicator for that area. The rest of the page can be displayed before the data is in. If you navigate to a page that you have previously visited, chances are that all the information is already available and can be displayed immediately. This makes the entire application feel smoother; there are no interruptions.
3. Background sync
One way to spice up SPAs is to sync changes in the background. On traditional web pages, submitting a form causes the browser to send information to the server and load a new document.
With SPAs, the information can be stored locally and uploaded in the background. This means that saving changes can appear immediately.
4. Better use of development capacity
The Alloq teams are a multidisciplinary team, in which different members are specialized in different domains. Previously, the software engineers who specialized in translating asset management into code had many additional tasks. The SPA relieves them of some work, as some responsibilities shift to other engineers with different expertise. The workload is now more balanced and the engineers can work more autonomously in their respective fields.
5. Scalable basis
Since Alloq is a SPA, the platform gives us an incredible foundation to add new complex functions. SPAs excel at displaying real-time information, and we have big plans to take advantage of that. For example, we can show in real time how a cash flow adjustment affects your portfolio.
What’s the catch?
Obviously, we can’t get all of this for free. As a result, a SPA increases the initial load. If all the pages and logic to load information are crammed into one page, the download will of course be larger. If you think we’ve just moved the load time to the first load, it’s not that clear.
Instead of frequent interruptions, the user only has to wait a few milliseconds longer when opening Alloq. Only once, as we use the browser cache to reduce that initial load when you return to Alloq for the second or third time. When you open the platform, the browser saves some parts of the application o