From 650d03abf3d766b03124baaa936e2a6838c2f1b1 Mon Sep 17 00:00:00 2001 From: "Valentin V. Bartenev" Date: Wed, 6 May 2026 22:30:22 +0300 Subject: [PATCH] Web: allow browser caching of static HTML pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The login, app, and stats HTML pages are static assets compiled into PROGMEM. All dynamic content is fetched separately via JavaScript API calls after the page loads — the HTML itself never changes between requests within the same firmware version. The "Cache-Control: no-store" header forced the browser to re-download the full HTML on every visit, including a complete chunked transfer from the ESP32. Given that the ESP32 is slow and serves responses in small chunks, this was an unnecessary repeated cost that added latency before the page became interactive. Removing no-store allows the browser to cache the HTML pages locally. Subsequent requests are served from the browser cache instantly, with no transfer from the ESP32 at all, leaving the server free to handle the API requests that actually carry dynamic data. --- src/helpers/web/WebPanelServer.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/helpers/web/WebPanelServer.cpp b/src/helpers/web/WebPanelServer.cpp index 26d5bd19..bd457293 100644 --- a/src/helpers/web/WebPanelServer.cpp +++ b/src/helpers/web/WebPanelServer.cpp @@ -2682,7 +2682,6 @@ esp_err_t WebPanelServer::handleIndex(httpd_req_t* req) { } ctx->self->noteActivity(); httpd_resp_set_type(req, "text/html; charset=utf-8"); - httpd_resp_set_hdr(req, "Cache-Control", "no-store"); return sendProgmemChunked(req, kWebPanelLoginHtml); } @@ -2709,7 +2708,6 @@ esp_err_t WebPanelServer::handleApp(httpd_req_t* req) { } ctx->self->noteActivity(); httpd_resp_set_type(req, "text/html; charset=utf-8"); - httpd_resp_set_hdr(req, "Cache-Control", "no-store"); return sendProgmemChunked(req, kWebPanelAppHtml); } @@ -2720,7 +2718,6 @@ esp_err_t WebPanelServer::handleStatsPage(httpd_req_t* req) { } ctx->self->noteActivity(); httpd_resp_set_type(req, "text/html; charset=utf-8"); - httpd_resp_set_hdr(req, "Cache-Control", "no-store"); if (ctx->self->_runner != nullptr && !ctx->self->_runner->isWebStatsEnabled()) { return sendProgmemChunked(req, kWebPanelStatsDisabledHtml); }