Why data is loading slower in LIVE website?
Why data is loading slower in LIVE website?
iftikharuddin
Posts: 18Questions: 5Answers: 0
I'm trying to load data from a table which contains 3k records. Data loads very fast in local server but when i deployed my code to server (live website) it takes 20-30 seconds to load the whole data.
My code:
```ajaxUrl: '<?php echo $this->MyHelper->Route('admin-get-blog-articles-faq')?>',
columns: [
my.common.admin.tableEditColumn('id'),
{ data: 'question' },
{ data: 'created_at' }
],```
Table code:
```<table id="records-table" class="table table-striped table-bordered" width="100%">
<thead>
<tr>
<th></th>
<th class="hasinput">
<input type="text" class="form-control filter" placeholder="Question">
</th>
<th class="hasinput">
<input type="text" class="form-control filter" placeholder="Date Created">
</th>
</tr>
<tr>
<th></th>
<th class="all">Question</th>
<th class="all">Date Created</th>
</tr>
</thead>
<tbody></tbody>
</table>```
Controller func:
```public function getBlogArticlesFaqAction() {
//Get all Blog Articles FAQ from DB
$blogArticlesFaq = BlogArticleFaqModel::getAllForDataTable(array('id', 'question', 'created_at'));
// Return data array
return array('data' => $blogArticlesFaq);
}```
This discussion has been closed.
Answers
Hi @iftikharuddin ,
It could be any part of the process:
The best bet is to profile each of those and find the differences.
Cheers,
Colin