Answer the question
In order to leave comments, you need to log in
How does SPA work when opening additional tabs in the browser?
Let's say we are talking about e-commerce - I often open a bunch of tabs on such sites.
ReactJs + flux
If the site is a Single Page Application, then obviously this SPA will be loaded on each tab separately. And it will probably consume significantly more memory than a similar non-SPA site.
1. Right?
But that's not the point. I'm more concerned about what happens to the variables that are generated during the SPA.
Specifically: the user searches for the characteristics of goods in the catalog. Gets a specific search result. This output hangs as a json array in the SPA. When going to the product page, SPA takes additional information already received from this array, so as not to access the database once again and render the page with lightning speed. From there, it takes goods that will be displayed as "similar offers".
2. So, if the product is opened in a new tab, this system will not work, will it? How then to transfer this array?
Answer the question
In order to leave comments, you need to log in
SPA = Single page app. In other words, everything happens on one page. If you open an adjacent tab, then yes - you need to load everything again. But in fact, the application itself is already in the browser cache and you only need to download content that can also be cached by this moment.
Look towards isomorphic applications where react is rendered both on the server and on the client. Moreover, HTML with data is already coming to the client.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question