I have a bare-metal application running on a tiny 16 bit microcontroller (St10) with 10BASE-T Ethernet (CS8900) and a Tcp/IP implementation based upon the EasyWeb project.
There is a tiny webserver implemented for displaying some status information of the device and also allows to change settings et cetera.
For browser access, the webserver provides some files like index.html, *.css, *.js, *.svg, *.png and so on.
As the bare-metal target has no storage media like a sd-card, I put all of the above mentioned resources into the compiled binary.
For saving memory and reducing traffic, I put all of the files together into a single index.html compress that using gzip and let my webserver deliver this using Content-Encoding: gzip.
The step to put all the files together into single index.htm is currently manual work (incl. replace filename references et cetera). Might there be a tool which do this automatically?
Or alternatively, can I just zip / tar / whatever all the files into a single file and deliver this upon http GET / request?
Edit 2017-10-05
Solved by using the inliner mentioned by brain99.
Having small trouble making it run on Kubuntu 16.04 host but finally fixed it by installing:
sudo apt-get install nodejs
sudo ln -sT "$(which nodejs)" /usr/local/bin/node
sudo apt-get install npm
sudo npm install -g inliner
Maybe, I'd got rid of the symlink by using nodejs-legacy instead of nodejs (have not tried).
After having installed that, I just need to run:
inliner index.html >index-backed.html
gzip -c index-backed.html >index.html.gz