Replace native bindings to C code with code that runs entirely in node
Both zopfli and brotli are no good fit for fastest time to first byte and overall request time
shrink-ray caches files in memory which might lead to high memory consumption
On 1.
Having native bindings is an issue when you want to deploy on function as a service engines lika AWS Lambda. node_modules have to be moved to Lambda and Lambda is running on AWS Linux. So this means a deploy can only happen from linux machines with exact same architecture. There is a wasm port of brotli, but this one don't support streaming.
On 2.
Both algorithms are not meant to be done in web request streams. They are more than 80x slower which leads to a big time overhead.
On 3.
In most cases the better architecture is to have a caching CDN in front of the webserver.
Purpose of this PR:
On 1.
Having native bindings is an issue when you want to deploy on function as a service engines lika AWS Lambda. node_modules have to be moved to Lambda and Lambda is running on AWS Linux. So this means a deploy can only happen from linux machines with exact same architecture. There is a wasm port of brotli, but this one don't support streaming.
On 2.
Both algorithms are not meant to be done in web request streams. They are more than 80x slower which leads to a big time overhead.
On 3.
In most cases the better architecture is to have a caching CDN in front of the webserver.
Changes
This PR replaces shrink-ray with compression