One Table, multiple data adresses

One Table, multiple data adresses

El_MatellaEl_Matella Posts: 12Questions: 6Answers: 0

Hi everyone :)

I am struggling with time loading of some tables of my program containing a lot of rows. The server side is using PHP/MySQL and is generating a new Json Document everytime I reload the page.

I would like to do the following:

1- Load the page
2- Ajax Request call to website.com/myproducts/
3- Ajax Request call to website.com/myproducts?refresh

The goal would be to save time displaying the table even if all the values aren't updated, using the website.com/myproducts/ URL returning a real Json file saved on the server, and then, update the table and the json file called on step 2 with the data on the SQL server.

How could I achieve that with datatable? Refreshing the table with two different URLs?

Don't hesitate to ask me to be more precise.

Thank you very much for your advices and have a nice week (and a happy new year!)

Cheers!

Answers

  • glendersonglenderson Posts: 231Questions: 11Answers: 29

    Might I suggest that you merely query a database and drop the json file stored on the server?

    I have several tables in the 10,000 record range and a few in the 100,000 records.

    If they load slowly, then I switch to server side processing (ajax page). If they load quickly, I use dataTables with an ajax page. I would never suggest having the server create a json file that datatables read.

    Always limit the number of records to display at a time, 50 or 100 for example. You should have no problems and your data will always be the latest.

    When write your own ajax pages, the response must be in a json format, no html.

This discussion has been closed.