A
A
Alexander Radenko2019-03-14 10:33:31
Yii
Alexander Radenko, 2019-03-14 10:33:31

How to organize the loading of content on the page in the background (website on Yii2)?

Good day. Essence of the question. There is a page where products are displayed. Goods are divided into warehouse, custom and so on. The process of selecting a product from the database and calculating the price is quite lengthy in terms of the very logic of selecting and issuing goods on request. What is the idea: get content in parts. First, a warehouse product (there are fewer of them, it is considered faster), display them on the page. The user already sees the product and can "work" with it (put it in the cart, etc.). In the background, continue to receive goods from the database and upload them to the page in your blocks, and at the end of the download, finally form the page, display filters, for example, a list of brands. A request to get goods from the database is an asynchronous Ajax request consisting of several parts (let's say 4 requests). Waiting for the full result and withdrawing is a long time. How best to display content in parts. I would be grateful for the proposed implementation options.
A small request not to write about query optimization. The specificity is that they are not performed quickly. And it's better to display the results as you get them.
The site is powered by Yii2 2.0.14 php 5.6

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question