- Thu Aug 20, 2015 1:18 pm
#26605
Great writeup - but just to compare. I'm sending a 152,7 KB page to my browser in 0,3 - 0,4 seconds. 120 KB is bootstrap CSS from a CDN so not directly from the ESP. So to be fair I removed that css from my page - 215 lines of code for the HTML and CSS. Now the size was down to approx 10 KB reported in Safari and a transfer speed of 0,15 - 0,2 seconds. Pretty fast IMO.
I cleared my cache after each run...
I'm writing the code to the ESP flash like this:
Code: Select all String str = "";
str += F("<!DOCTYPE html>");
str += F("<html>");
str += F(" <head>");
str += F(" <title>Page title</title>");
str += F(" <link rel='stylesheet' type='text/css' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>");
str += F(" <style>");
str += F(" </style>");
str += F(" <meta charset='utf-8' />");
str += F(" <meta name='viewport' content='width=device-width, initial-scale=1'>");
str += F(" </head>");
str += F(" <body>");
str += F(" <div class='container'><form method='post' enctype='multipart/form-data' accept-charset='UTF-8'>");
str += F(" <div class='section'>");
str += F(" </div>");
str += F(" </form></div>");
str += F(" </body>");
str += F("</html>");
WebServer.send(200, "text/html", str);
As you can see, I'm using the server.send variant, so it seems writing to flash also makes a considerable impact on load times.