Arduino Web Server's Lagging Response

Hi there,

I've successfully implemented control of four LEDs using Arduino web server. I'm having some problem with the response time of Arduino. On average, after pressing the buttion on web page, it takes almost 450 miliseconds to handle the request. That is a lot. I want to reduce this time. Any help would be appreciated. My code and timing snapshots have been given below.
My codes have been attached.

Following is the screenshot of timing:

http://s15.postimg.org/xbt8mhd9n/arduino_response.jpg

Here is the link to switch.htm
http://freetexthost.com/fwheiob6mk

SD_4_buttons_working.ino (7.69 KB)

Please read #7 below about how to post your code for easy readding:

http://forum.arduino.cc/index.php/topic,148850.0.html

I tried to post the code that way, but an error prompted that post cannot be greater than 9000 characters. So I was stuck with this option. Also, due to some reason, I couldn't attach switch.htm, so I had to paste it on an online text hosting service. Thanks for your reply anyway.