Do I upload all the data directly into the HTML page or access the database more often?

Asked

Viewed 28 times

0

I’m developing a web project for real estate. On the page is the mirror of sales or the floor plan of the condominium of houses to be sold. When the user clicks on one of the plant houses, the system shows all the characteristics of that house. I am in doubt if it is better to load the page already put in the HTML itself in each house or button the information about the house... Ex:

<input id="casa02" type="button" alt="metragem=200m2*preço=R$80000*cor=branca" onclick="abrePopupDetalhes(this.id)"/>

...So when you click on it, javascript takes what’s in the "alt" and shows in the popup. This is just a simple example, in the real system are much more data than in this example. Or it is better to search the database for information every click?

That is, is it more harmful the html of the page get heavier or the page access the server every click? I’m worried about mobile access because of 3G.

  • The ideal is to load and show only what matters and is visible on the screen, as images, for example. In the case of images, there is a plugin called lazyload that only loads images when it is scrolled on the screen. This saves a lot of bandwidth and makes the page faster to load.

1 answer

0

If you could load directly into html would be better, mainly that works with mobile internet. The request in the database would be great.

  • Thanks Maick. I did so the 1st version of the system, but I started to wonder if it would hurt to open this page in 3G.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.