是否可以从基于ESP8266(NodeMCU v1.0)的服务器向客户端浏览器发送高达200Kb的html文件。
当前,我正在使用以下方法:
html页面已分配给char数组
const char myPage[] PROGMEM = R"=====( <my html page with javascript> )=====";
根据请求将页面发送给客户端
ESP8266WebServer server(80);
server.on("/", handleRoot);
handleRoot(){
String page = myPage;
server.send(200, 'text/html', page);
}
从浏览器中访问URL时,响应标题中将显示以下内容:
Cache-Control: no-cache
Connection: close
Content-Length: 0
Content-Type: text/html
这种方法适用于10至15 Kb的较小文件(根据我的测试)。