Now for my page, on some slow mobile devices, it takes a rather long time to load. I had all the database retrieval on the top of the page. I wonder if I put the database thing on the end of the page, like the way below, can I have a better performance of load time?
<html>
<body>
//Something to show to users before page fully loaded
<div>...</div>
<?php
// loadiing the stuffs
// Sql connection and etc.. ?>
<div><?php echo $variables; ?></div>
<script>
$('.values').html('<?php echo $values; ?>');
</script>
That is, I have the html first, and load the content to the page later (or through JS), would it decrease the time where users see only a blank page? Thanks for your input!