ring-gzip
ring-gzip copied to clipboard
Extending supported types whitelist
There are many other extensions which could be added to supported-type?
, for example .svg and .txt.
Could arbitrary types be added as settings somewhere? Or at least a more extensive list of uncompressed data types used on the web included.
Thanks!
Is there any reason to keep the supported-type?
check at all? Was this added to avoid re-gzipping .gz
files or something like that?
It seems like any response content can be gzipped if requested, so why filter on the file extension?
Is there any reason to keep the
supported-type?
check at all? Was this added to avoid re-gzipping.gz
files or something like that?It seems like any response content can be gzipped if requested, so why filter on the file extension?
There is no reason to try and zip already compressed items like png, jpeg, zip, 7z, gz...etc. It is even likely to be slower because the CPU time to compress them results in files exactly the same size or larger.
I also would like to see an option to pass a string to extend the supported types whitelist.
There are many other extensions which could be added to
supported-type?
, for example .svg and .txt. Could arbitrary types be added as settings somewhere? Or at least a more extensive list of uncompressed data types used on the web included.Thanks!
Its clearly a simple change to add extensions the the white list. Do you have a more extensive white list that you can propose?
@sirmspencer, not necessarily, and I don't believe it should be something this repo tries to maintain. Perhaps it could also determine from MIME type.
Maybe a blacklist instead? e.g. compressed-type?