0

I have a report in my codeigniter project which is complex report having more than 100 pages.

For that I am using ajax to retrieve data.

There are more than 60+ ajax requests for that I am using set time out to run each request.

Reports took almost 8 minutes to complete.

That's why I want to run crone, but when I added crone it is not running ajax code via linux,

Is there any way to run this whole process from back-end (No use of browser) or from linux?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701

1 Answers1

0

If you are looking for Non-Browser option then there is no need to do it with ajax. You can do the same action with the pure PHP scripts. You convert 60+ ajax request to different functions and call those function after some time interval.

Ish
  • 2,085
  • 3
  • 21
  • 38
  • But my requirement is ajax , because i have lot of highcharts in my report, and for creating pdf i am using highchart's export server to convert my graphs to images and then i am creating pdf after last loop. – Mehreen Mirza Aug 29 '16 at 07:58
  • If you are using ajax just for converting highchart to images, then I would suggest you to store the HTML canvas which highchart generate into DB and while executing the cron convert it into image. Highchart just need canvas to convert it into image. You don't need ajax call here. – Ish Aug 29 '16 at 08:05
  • if i agree on your canvas point , then how can you plot a highcharts without js, js is involved at every point. – Mehreen Mirza Aug 29 '16 at 08:14
  • You mentioned '(No use of browser)'. Browser would definitely needed if you want to plot a graph on browser. I still dont know what you are doing but what you can do is - Plot the graph with js, save the canvas in db, run the cron at every min or whatever you want. You can divide browser centric and non browser centric task. All non browser centric can go to cronjobs. – Ish Aug 29 '16 at 08:19