AJAX page load suddenly taking forever

AJAX page load suddenly taking forever

Rod.J.MillerRod.J.Miller Posts: 8Questions: 2Answers: 0

All of a sudden today the datatables report I'm running is taking forever to load. The processing text stays up for over 2 mins and there are 1 or 2 unresponsive messages before it all loads.

Its 58 columns and 5000 rows, it loads eventually but when it does it loads every record. Even though I have told it to load the first 10 records only.

the settings i'm using are:

        dom: '<"top"Bfirt><"bottom"pl><"clear">',
        processing: true,
        serverSide: true,
        ajax: '../controllers/mainTableView.php',
        deferRender: true,
        responsive: true,
        paging: true,
        lengthMenu: [[5, 10, 25, 59, -1], [5, 10, 25, 50, "All"]],
        order: [[1, 'desc']],
        displayLength: 10,

I'm using the latest version of Editor and DataTables.

The Debugger information on the Table is:

main

Data source: Ajax
Processing mode: Server-side
Draws: 1
Columns: 58
Rows - total: 5088
Rows - after search: 5088
Display start: 0
Display length: 10

All of the Version checks ae ok no failures in other tests.

It just seems like it doesn't want to obey the 10 record limit and everything loads.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947

    It just seems like it doesn't want to obey the 10 record limit and everything loads.

    That is the responsibility of your server script. Are you using a Datatables provided server side processing script?

    Kevin

  • Rod.J.MillerRod.J.Miller Posts: 8Questions: 2Answers: 0

    Yes I am, its only been in the last few days that it has been giving me issues.

    The only thing I've done is updated the core dataTables files.

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947
    edited June 2020

    It just seems like it doesn't want to obey the 10 record limit and everything loads.

    How did you confirm that all the records are returned instead of just 10? Did you use the browser's network inspector for this?

    The only thing I've done is updated the core dataTables files.

    Did you go back to the previous versions to see if the load time is back to normal?

    Can you post a link to your page or a test case showing the issue? If there is a problem with the latest Datatables code they will want to take a look to fix the issue. You can PM @allan a link if you don't want to post it.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • Rod.J.MillerRod.J.Miller Posts: 8Questions: 2Answers: 0

    I've attached 3 images, one shows the page as its loading.

    The next when it loads, it now shows NaN for the number of records not the actual number. 5088

    And the footer shows the records with the pagination on the bottom.

    When you try to use the pagination to see if it might load 10 records instead of all, it reloads all of the records again.

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947
    Answer ✓

    When you try to use the pagination to see if it might load 10 records instead of all, it reloads all of the records again.

    Are you using the browser's network inspector to verify the number of records in the response?

    If the server is actually returning all the records then start by verifying the proper server script is being used. Does the Ajax response contain the parameters as defined in the Server Side Processing docs?
    https://datatables.net/manual/server-side#Returned-data

    Kevin

  • Rod.J.MillerRod.J.Miller Posts: 8Questions: 2Answers: 0

    Hi Kevin

    I have just gone back and verified that it works under the old version.

    Loads quickly and without problems.

  • Rod.J.MillerRod.J.Miller Posts: 8Questions: 2Answers: 0

    Just to let you know, it was an error with an older version of fixed header that was causing the issue. It kept trying to write a search box above every data cell.

    At 58 columns and 5088 row's it was struggling.

This discussion has been closed.