How to load data on the client?

Then came the idea to write some website on Angular + Express, and there was a dilemma how best to get the data once when you first boot to get everything to fly through the site, or ship for a little bit if necessary?
July 9th 19 at 10:54
4 answers
July 9th 19 at 10:56
To download to the user what he wants to see, then in the background load the rest to fly)
July 9th 19 at 10:58
Divide into three parts:
  • the first screen - critical css, js, critical, critical data - all necessary to show the first screen in the browser as quickly as possible
  • the main content that in any case the need for a second screen and support elements
  • everything else - advertising banners, graphs, Analytics, etc

More detail view here:

You can also add part 4 is what you may need because it is hot data (e.g. news, a list of friend activity, and so on)
July 9th 19 at 11:00
For "some website" this question cannot be answered, depends on what kind of website what data.
July 9th 19 at 11:02
It will be something like forum. And the question is how to pull all the topics, rooms, and messages at once, or for each page to make your query to retrieve only needed for the data?
For the forum just do not need to upload "everything" in advance. As:
  • sections can be a lot
  • the more
  • messages quite a huge amount - so many just do not need every user
- Alyson.McClure commented on July 9th 19 at 11:05

Find more questions by tags JavaScriptAngularExpress.jsWeb Development