Plz Help Me about DataTables Speed Up

Plz Help Me about DataTables Speed Up

wnsgurkimwnsgurkim Posts: 1Questions: 1Answers: 0

Hello I make Datatables table body by html & php (Not Ajax)
.
But I want to Speed up my data table... So I find about DeferRender.
.
But I dont use ajax or json.
.
only i can use php.
.
How do i change php code to ajax code...
.
code sample is below.
.
.
<tbody class="tbody">
<?php if(mysqli_num_rows($query) > 0){ while($rows = mysqli_fetch_assoc($query)){ ?>
<tr class="rows RowsShow Rows<?=$rows['city1']?> Rows<?=$rows['format']?> Rows<?=$rows['onoff']?>">
<td class="hidden"><div><?=$rows['start']?></div></td>
<td class="hidden"><div><?=$rows['finish']?></div></td>
<td class="hidden"><div><?=$rows['recent']?></div></td>
<td class="wrap">
<a href="https://archivist.kr/show/scroll.php?pagecode=<?=$rows['pagecode']?>">
<div class="imgwrap">
<?php if(empty($rows['video'])){ ?><img src="https://archivist.kr/registration/show/image/<?=$rows['posterimg']?>">
<?php } else{ ?><video src="https://archivist.kr/registration/show/image/<?=$rows['video']?>" autoplay loop muted></video><?php } ?>
</div>
<div class="textwrap">
<div class="head">
<table>
<tr>
<td><div class="space"><span class="ellipsis"><?=$rows['space']?></span></div></td>
<td>
<div class="onoff">
<?php $finish = $rows['finish']; $idx = $rows['idx']; $pagecode = $rows['pagecode'];
if(date("Y-m-d", strtotime("$finish +1 days")) == date("Y-m-d")){
mysqli_query($connection, "UPDATE show_table SET onoff = 'Finished' WHERE idx = '$idx'");
mysqli_query($connection, "UPDATE mydb_table SET onoff = 'Finished' WHERE pagecode = '$pagecode'");
}
?>
<?php if($rows['onoff'] == "Finished"){ echo "<span class='finished'>종료</span>"; } else{ ?>
<script>var now=new Date();var then=new Date('<?=$rows['finish']?>');var gap=now.getTime()-then.getTime();gap=Math.floor(gap/(1000606024))-1;document.write('종료까지 '+gap+'일');</script>
<?php } ?>
</div>
</td>
</tr>
</table>
</div>
<div class="title"><span class="ellipsis"><?=$rows['title']?><span class="subtitle"><?=$rows['subtitle']?></span></span></div>
<div class="period"><?=$rows['period']?></div>
<div class="location">
<table>
<tr>
<td><div><?=$rows['city2']?></div></td>
<td><div class="recent"><?=$rows['recent']?></div></td>
</tr>
</table>
</div>
</div>
</a>
</td>
<!-- MyDB -->
<?php include 'show/controller.php'; ?>
</tr>
<?php } } ?>
</tbody>

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    This section of the FAQ should help, it discusses various techniques to improve performance,

    Cheers,

    Colin

Sign In or Register to comment.