esp-idf rest_server

Atalaya
Posts: 11
Joined: Mon Jan 10, 2022 7:56 am

esp-idf rest_server

Postby Atalaya » Tue Jan 03, 2023 2:31 pm

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

Who is online

Users browsing this forum: Bing [Bot] and 81 guests