View Full Version : Page taking too much time in updating the value.

03-12-2010, 07:09 AM
Hi All,

I have created one page in php where in from drop down user can choose value and after clicking on the update button it is updated in db, there are so many fields and drop downs in the page but specifically for two drop downs values it is taking more than a min to update the value. I am making use of AJAX here and after clicking on the update button for the above mentioned fields user can scroll up and down the page and if he clicks on some other button then it throws some error.

I have added below mentioned code also but still same problem.

header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');

Can anyone tell how to fix this issue.Thanks in advance ...

03-12-2010, 05:37 PM
Is it a case where the UPDATE statement is gnarly? Or is it the communication from and to the server that is taking so much time?

You should install and use the Firefox plugin Firebug to investigate-- every Ajax call is written to the console, including how much time it took, and a bunch of other helpful info.

If the UPDATE statement is what is taking so long, you need to change your database design so you can take advantage of an index.

03-15-2010, 07:12 AM
Thanks for your response.

The same code is deployed on two servers but it is creating trouble only in one server and the other one is working fine after greping the messages in the log file I have found that it is taking time only in those cases wherein after updating the value in DB the mail is sent. Actually my application sends back the response to the front page through AJAX once updation and mail is sent. So it is basically the mail server which is creating the trouble.

If you can plz tell how to make the mail server somewhat faster so that the page has not to wait for 50 sec to load because it is loaded only when mail is sent. For confirmation I commented out the mail sending part in the code and it started working fine.

03-15-2010, 05:01 PM
I guess your network admins need to get their butts in gear and fix your mail server!