I wrote a CSS server that performs minimization and basic replace / replace. The server uses node.js.
I want gzip my answer from this server. As the IRC says, there is currently no gzip library in the node.js file, so I'm trying to do this manually from the command line (since I use gzip only when not in the cache).
I have 'gzip -c -9 -q ' + tempFile file data in a temporary file and then use exec to call 'gzip -c -9 -q ' + tempFile . I correctly return the compressed data (it seems) and send the correct Content-Encoding header as 'gzip' , but Chrome reports:
Error 330 (net::ERR_CONTENT_DECODING_FAILED): Unknown error .
In addition, some independent gzip testers online also do not work (not just Chrome).
I guess this is something simple that I donβt know about generating gzip blocks for browsers, since I never tried to do it manually.
Any help would be helpful. The server is very fast, but I need to compress the content to get the best performance for end users.
Thank you
UPDATE I confirmed that my Content-Length is correct
source share