[web_server][captive_portal] Add Brotli compression (saves ~11KB flash when using local) (#12959)

This commit is contained in:
J. Nick Koston
2026-01-07 11:49:23 -10:00
committed by GitHub
parent e29523e248
commit 1339f3e77e
11 changed files with 8961 additions and 4773 deletions
@@ -422,7 +422,11 @@ void WebServer::handle_index_request(AsyncWebServerRequest *request) {
#else
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", INDEX_GZ, sizeof(INDEX_GZ));
#endif
#ifdef USE_WEBSERVER_GZIP
response->addHeader(ESPHOME_F("Content-Encoding"), ESPHOME_F("gzip"));
#else
response->addHeader(ESPHOME_F("Content-Encoding"), ESPHOME_F("br"));
#endif
request->send(response);
}
#elif USE_WEBSERVER_VERSION >= 2