[thelist] loading page

Lauri Väin lauri_lists at tharapita.com
Tue Apr 25 11:10:13 CDT 2006


The answer is that it depends. Down to the level of what kind of application 
you have and what approach you are taking - synchronous vs asynchronous.

Usually it batch processes are frontloaded with information fetching and 
loading tasks and generation oftentimes does not happen until very late in 
the process. 5-10 minutes is quite a long time and it will probably not get 

The answer for many report generations is to make it an asynchronous 
process, especially as it grows in complexity and in numbers. You have the 
user upload the file or give the task to generate the report. You have a 
periodic batch job (cli PHP, for example) that reads new tasks and when it 
finds one, starts to process it. Once it is done, it will change the status 
in some database or add a file to some category. Or depending on your data 
sources, the reports are periodically generated. The trick is to get the 
monitoring part right.

The user-facing side would either display the new processed reports (and the 
ones still in processing) as a table on either a page load or do some fancy 
AJAX, like somebody already suggested. Though I believe the user will have 
plenty of other things to do and AJAX is just overkill for it. That might be 
true for both internal (your own company reporting) and external 
applications (customers of you). Though there are use cases for AJAX too... 
even once the buzzword mania will pass.

If you want to do it in real time still (which will not scale very far, but 
scaling is not necessarily an issue in many systems), display something 
simple, like a progress bar.


More information about the thelist mailing list