Webduino. Page load unreliable

I'm currently working on providing board information via a web page. I'm having some troubles because the loading of the page is very unreliable. Sometimes the page loads fully, sometimes I get "The connection to the server was reset while the page was loading." and sometimes the page only loads partially.
I have no clue on why this is happening.
I have added code to dump the send content into the serial monitor and it pops up correctly there.
I have added code to dump errors in the serial monitor but no errors are logged.
I experimented with keeping the line open (not calling m_client.stop(); but calling m_client.flush():wink:
But nothing seems to improve the "reliability"
I'm using a mega and there should be enough memory

Device: atmega2560

Program:   35470 bytes (13.5% Full)
(.text + .data + .bootloader)

Data:       2349 bytes (28.7% Full)
(.data + .bss + .noinit)

I have the impression the problem got worse when the html code grew (I'm reading the file from a sd card)
Currently my file is 1.748 bytes.
Anyone any idea on what is happening or how to resolve this?
Best regards

I’m pretty sure that type of error is due to some server issue.
Modifying your code may not fix this.

What sort of server are you accessing, a common website, local apache/iis server, free web hosting?

Or maybe some connection data is getting corrupted on your end causing the server to reset the connection

EDIT: found this, http://arduino.cc/forum/index.php?topic=79962.0 maybe you are closing the connection to early

Thanks for the answer.
I've read through the treads but I think they are not related. I think so because I'm playing server and not client.
Any thoughs
best regards

I identified the problem. It had nothing to do with the arduino code. I would like to work around it using the arduino code.
The problem was solved when I connected the Arduino directly to my router using a network cable. Before I connected my Arduino to a netgear box with a network cable. The netgear box translates the network cable interface to a wifi signal.
As wifi is slower than network cable I now assume the netgear dropped information.
Any Ideas on how to best slowdown the sending of data (the big file is not send that much)
Best regards

EDIT: For those who would value netgear on this post. My assumption on the slow wifi is correct however it was not due to the netgear but due to a setting on my wireless router. Now all works fine.
For those interested. I had channel number set on auto. Replacing it with a fixed channel makes all work fine.