Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Gheotic
#73987 I've been looking for a HTML, CSS and javascript minifier/compressor that could convert a whole directory with webfiles in subfolders, and convert them in to smallest possible format. To minimal the storage needed on the ESP.

Without luck...
So I tried it myself using Python https://github.com/Gheotic/ESP-HTML-Compressor.

Which could generates a file with the something like this:
Code: Select all<!DOCTYPE html>
<html>
<body>
   <h1>My First Heading</h1>
   <p>My first paragraph.</p>
</body>
</html>

into something like this:
Code: Select all// /index.html
const char* data_index_html_path PROGMEM = "/index.html";
const char data_index_html[] PROGMEM = {0X3C,0X68,0X74....};

which could be implemented like this:
Code: Select all  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    Serial.println("Index.html requested");
    request->send_P(200, "text/html", data_index_html);
  });


I do not know if I'm the only one who have been needing something like this, but I hope I could be useful for others too.
I am definitely excited about this! :D