Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82034

Why data is loading slower in LIVE website?

$
0
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);
}```

Viewing all articles
Browse latest Browse all 82034

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>