Menu

#368 Gzipped content support

New
nobody
None
Medium
Defect
2012-06-26
2012-06-26
Anonymous
No

Originally created by: stephen....@yahoo.co.uk

I see that there were numerous requests to have gzipped files served via mongoose. This is my solution, as I also needed to serve content from my embedded equipment through a sloooow GPRS link. The concept is as follows:

Check request header for Allow-Encoding:gzip, if it is found, then when you want to open the file to send, check if there is a copy of the same file with a '.gz' extension, if so, serve that one instead, update the Content-Length parameter to reflect the shorter file and add an extra line 'Content-Encoding: gzip\r\n' to the response header.

The attatched file is my attempt at providing this feature, to use it,
replace the 'handle_file_request()' function in mongoose.c with my version, NOTE! Not implemented for ssi.

Have tested it in windows (VC6) and on linux on arm9 embedded platform.

1 Attachments

Discussion


Log in to post a comment.