Can I reduce loading time?

Can I reduce loading time?

MrDawnMrDawn Posts: 2Questions: 1Answers: 0

Hi there!

So I use datatables for my administration application and the logic behind that is that it loads up data from database like products and I use the last column to load some buttons. These buttons leads to a processing file where I do the processing like delete the "selected" row and so on. My problem is, that even with 400 rows my table loads incredibly slow. Loading time is around 3-4 seconds. First I tought it's my query but I tested it and it wont. Then I commented out the buttons at the end what gave me a 1.2 seconds load time so it's the amount of texts inside the table. Well i know I can use server side processing but the problem is I use datatables only for showing my php queries. I know its not the way to use it but I am not so good with js and ajax but I needed a reliable free pagination so I decided to use it that way. Sooo for useing SSP....I has to rewrite the whole code and the logic behind it what I want to avoid if possible.

One of my rows:

<tr role="row" class="odd"> <td>780</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td class="text-nowrap">dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td>dfgdfgdfgdfg</td> <td> <form class="btn-group my-1" method="get" action="handler.php"> <button type="submit" class="btn btn-danger rounded" name="value" value="780" title="Modify Project"><i class="fas fa-cog"></i></button> <input type="hidden" name="action" value="update_project"> <input type="hidden" name="page" value="hu/admin.project"> </form> </td> </tr>

I have like 10 more of that form button at the end what causes the slow loading. Can I do sometihg with it? (value of the button sends the id of the project, update_project is the method which loads up a new page with a form where i can modify the data with input fields and after i hit ok it updates the project and redirects back. The last hidden input is the location of the current file for redirect after process cuz i dont use here php-self) So my question is, how can I accelerate the loading time? Maybe I can store the hu/admin.project into a session or cookie variable so I can save that row...

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

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

    Cheers,

    Colin

  • MrDawnMrDawn Posts: 2Questions: 1Answers: 0

    Thx Colin but as I mentioned I want to avoid the SSP if possible.... the FAQ you mentioned contains information about the SSP but I couldn't finde any useful stuff for my problem in it...

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin

    I think we'd need a link to a page demonstrating the slow speed to be able to offer much help here. We'd then be able to profile its network characteristics and also its JS runtime performance.

    My guess is that the PHP generated table is taking while a while to build and then download and rendering into the page. Only at that point can DataTables then kick in.

    The FAQ Colin linked to doesn't just suggest server-side processing, but also Ajax loading the data, while still doing client-side processing. That is normally the first step in improving performance for such tables, but if you give me a link to a demo showing it, I'll be able to confirm where the slow down is happening.

    Allan

This discussion has been closed.