ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By martonmiklos
#8645 Hey Sprite_tm,

I have added support for gzipping the static css, js, html files, which helps both with saving flash space and both bandwidth if dealing with large static text files. The feature can be enabled/disabeld in the Makefile. If enabled it gzips the js/css/html files and the webserver code also sends the Content-Encoding: gzip header if enabled.

BTW. what version of esptool do you use?
The command line arguments in the Makefile does not seems to be the same what is used by this esptool:
https://github.com/themadinventor/esptool

Thank you for your work on esp-httpd, it is a very useful project for me!
You do not have the required permissions to view the files attached to this post.
User avatar
By IgorTr
#8679 HI.
First of all, Thank you very much making this webserver public. My beer is your beer :-)

Two questions:

1. Is it possible to disable UART debug messages ? As far as I understand, a lot of this messgaes come
from non-public libs, so it's not possible to make it slient at all... I need UART to communicate this host CPU,
and do not want to filter debug messaging on host side.

2.Is it possible to switch to STA mode only in case then wifi network is not reachable ? Do I need to implement this
in timer routine, or there is some more graceful method for that ?

Thanks.
Igor.
User avatar
By martonmiklos
#8689 TL;DR: It works on top of it.

If enabled during the make process the html folder is copied to a temporary directory where all static css, js, html file get gzipped. Then the espfs will be generated from this temporary folder. As I have seen the heatshrink produces a little bit bigger files from the default project's gzipped contents. That is because it only contains a few compress-able files and on the gzipped files the heatshrink seems to be less efficient. But when using larger static files it produces far smaller image. For e.g. I have added a 93.5 KB jquery file to the default project (cats removed). With GZIP compression enabled the webpages.espfs is 37.3 KB while with GZIP disabled it 52.2 KB.

The another income from the GZIP-ing is the saved bandwidth when serving these files.