Page 1 of 1

esp-idf rest_server

Posted: Tue Jan 03, 2023 2:31 pm
by Atalaya
Hello group
A happy New year to one and all.
My question.
We have a program based on the ESP-IDF "http - rest_server" working well, but it is far too slow in loading. A mechanism we used with Arduino was to tell the browser to use its cache contents, having established a high cache age. This can help speed up subsequent page loads.

Is there an equivalent for the "rest_server" to this Arduino solution? An attribute to the
The Arduino solution we used, for example, is this:

server.on("/js/app.jgz", HTTP_GET, [](AsyncWebServerRequest * request) {
AsyncWebServerResponse* response = request->beginResponse(SPIFFS, "/js/app.jgz", "text/html");
response->addHeader("Cache-Control", "max-age=2628000");
response->addHeader("Content-Encoding", "gzip");
request->send(response);
});

I've looked in "./components/esp_http_server/include/esp_http_server.h" but no obvious solution to mind.

Thanks in advance