I'm running Zend server and ZF1 with db2 database. For some export, the queries take a very long time (>50 seconds) this causes a 408 timeout error. I'm looking for a solution to show a loading message on the client while running the SQL query. Any help is appreciated.
Loading message instead of timeout while executing a heavy query
423 Views Asked by Ayoub At
1
There are 1 best solutions below
Related Questions in PHP
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
Related Questions in ZEND-FRAMEWORK-MVC
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You need to increase the maximum execution time allowed for php so that it can finish and not be terminated with 408 return code. Either locally for that script only: http://php.net/manual/en/function.set-time-limit.php or globally: http://php.net/manual/en/info.configuration.php#ini.max-execution-time
The simplest way to show loading progress is to have the long job executed with an AJAX request. Your main page should show the loading progress and fire a request to the export script with Javascript. When that export script finishes, the main page can show a success message.
If the export script creates something like a CSV file that needs to be downloaded, rather than send that CSV as the response body you can output it to a file on the server and then send a url of that file in the response. Your Javascript in the main page can show that url and prompt the user to download it in the success message.
Another way to do it is to build a job queue. This can be done using a queuing system or just using a table of jobs in the database. When the user requests an export, you create a new job. You need a process that runs on the server, as a cron job for example, that checks the table for all new jobs, and when there is one it runs the export and updates the status of the job. In your page you need to periodically, with Javascript or simply by reloading the page, check the status of your job and show a success message when it's completed. Again, if the export creates a file, the server process needs to write it and you include a link to download in the success message.