Speed-up web page drawing/display in client's browser. Please Help!

Hello guys! I wrote a sketch that makes my arduino act as an web server, and works prettty good. The only one problem is that when web page is drawn in the client's browser's , I get for 1 second a jerky graph until the page is fully drawn.

I guess that's because I use a lot of CSS an HTML, my sketch is about 25000 bytes, and I use a lot of calls for client.print(F("some_HTML_&__CSS_statements")) function.

I've tried to reduce the calls to above function, in order to speed-up the page drawing , by joining in just a few data blocks lots of css/html statements, and place them in a string, and call client.print/println with string as parameter, but nothing works.

The compiler shows an error regarding missing 'closing " ', I just guess, that's because when it finds '\n\r' does'nt read the next line to check for 'closing " ' and treats everything as an syntax error.

That's why I need very much your help, please !!!

Is there any way to speed-up all data sending, (whitout killing my RAM) or I just reached the hardware limit of 16Hz, and nothing could be done?

Thank you very, very much, have a great day!

Can you put the CSS into a file and host it on a web server somewhere else?


what Arduino board, shield, library?

Yes Juraj, Arduino UNO, clone of Ethernet Shield W5100 based, SPI.h , Ethernet.h .
I can’t post it.
Just the web page itself (without implementation of c++,and other libraries) is about 10200 bytes.

Reduce the number of client.print() calls. Combine as many as you can. Every call to client.print() generates a new packet. The packet header is 48 bytes. You want the payload to be at least that big.

Thank you guys!
I just found that by placing html/css statements in qoutation marks, I can use just one call on client.print() function, still sending large amount of data.
For example:


That reduced my code, but not fixed my problem.

I think I was wrong at begining. As I remember now, the web page is stored in client's ram memory and then browser displays it at once when receives client.stop() signal. So, is not arudino that is slow but, I guess , is something wrong inside my html/css code.

Very strange is that, as I run the .html file, it works just fine, in my web browser. Guys, please if I'm wrong tell me! OK, I will check again .html file to see if I find any conflicts in the way different page's elements should be displayed

My mistake, should be inside of …bui is just an example.
My sketch now is very compact, and I have to remove some things (like some messages that are not in english) in order to post it, and that will take some time.

Should I post all the sketch, or just .html file?

Anyway, I need all the help I can get, so tomorrow I will try to do this.

Thanks you for your patience!

Should I post all the sketch

If you want help, yes.

or just .html file?

Do you really have an html FILE?