Effectively load a website with heavy content so that the user suffers from shorter duration

Over the past few days, watching several sites with heavy content, I found a very interesting thing ... some websites do this pretty well ...

What I discovered is that they load the content that the user first searches on the website, and let the other content, which requires a lot of computation, slowly deliver ..

For example, try opening facebook in a new browser so that you don't open facebook for a while, so that we can observe without the effect of the browser cache. The news channel will be loaded first on the page and other things, such as a ticker, chat, counting notifications and messages, etc. and even the remaining news feeds follow later.

My questions are: 1) What is really going on here? Because according to my knowledge, the web works as a request from a client and one response from a server with data.

2) How can I control which parts are loaded first, and run the show without expecting other data to be calculated on the server.

PS
I am currently working on php and will soon move on to rails, so I am mostly concerned about the answer to these languages ​​if any particular piece of technology exists. In any case, all answers are welcome, because someday they will be useful .. :)

+4
source share
2 answers

Facebook uses what they call BigPipe to send parts of the page as they render.

+3
source

Javascript is a solution.

Starter for ten is the following link:

http://www.codeproject.com/Articles/23768/Load-and-Display-Page-Contents-Asynchronously-with

+2
source

Source: https://habr.com/ru/post/1396483/


All Articles