Skip to content

Conversation

@Sgw32
Copy link
Owner

@Sgw32 Sgw32 commented Jan 29, 2026

Motivation

  • Serve pre-compressed frontend assets from flash with the correct HTTP headers so browsers accept gzip-encoded content.
  • Ensure binary assets (PNG) remain unmodified while text assets are compressed and embedded for smaller firmware size.

Description

  • Updated ESP32/Digifiz/main/digifiz_ws_server.c to serve the embedded gzipped HTML blob using the _gz_start/_gz_end symbols and to set httpd_resp_set_type(req, "text/html") plus the Content-Encoding: gzip header.
  • Updated ESP32/Digifiz/main/CMakeLists.txt to find_program(gzip), generate a data/dist output, produce .gz outputs for non-PNG files, register those files via EMBED_FILES, add a frontend_assets custom target and add_dependencies(${COMPONENT_LIB} frontend_assets) so assets are built before the component.
  • Added a small helper ESP32/Digifiz/main/compress_files.py to reproducibly create compressed artifacts offline and to copy PNGs unchanged.

Testing

  • No automated tests or CI jobs were run for these changes.

Codex Task

@Sgw32 Sgw32 merged commit 373da27 into main Jan 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants