Compressing Large HTML,CSS,JS files in ESP Progmem

Gheotic
Posts: 1
Joined: Thu Feb 15, 2018 10:15 am

Compressing Large HTML,CSS,JS files in ESP Progmem

Postby Gheotic » Thu Feb 15, 2018 10:36 am

I've been trying to find a sufficient way to store, webfiles on the ESP both for the ESP32 and ESP8266. I've tried a few different things so fare: Storing the files in SPIFFS, but was to slow to retrieve the data, and then timed out... Typing the HTML in a simple char array in progmem, but was too pain full process to keep updating it, for every single change in webfiles...

I then came by spacehuhn's esp8266_deauther https://github.com/spacehuhn/esp8266_deauther/tree/master/web_server
where he had clever way of doing it.

By running a .sh file, which took every single file and minified it, then converted it to a huge const char array with the hex values for every single file.

I tried using his version of it, with my own HTML, but without luck... So I instead made my own version written in Python, which did the same thing Github ESP-HTML-Compressor.

It works perfect for HTML files, but not quite with CSS and Javascript files...

After being compressed by the python script, and uploaded on the ESP32 to test, it delivers all the files as expected, but not in the correct format.

Image

What could be the cause of this?

Btw I've a put in an example in my Github project, which could reproduce the problem.

Who is online

Users browsing this forum: jano2358 and 8 guests