-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not mark SVGZ
files as compressible
#110
Comments
.svgz
files as compressibleSVGZ
files as compressible
Hm. I'm not sure what the course of action would be here. The "compression" applies to the mime type, not the extensions. This module is just a database of mime types, and only contains data for types. What do you think should be changed? Just remove "compression" flag from "image/svg+xml"? |
Yes, I'm also not sure, reason why I've opened this discussion.
Since SVGs are used quite a lot, and they compress very well, I personally don't think this project should not recommend SVGs to be compressed. What do you think about changing "image/svg+xml": {
"source": "iana",
"compressible": ["svg"],
"extensions": ["svg","svgz"]
} |
I really don't want to do that, because this is a database of mime type information, not extension data. For each mime type entry we have keys that tell aspects of the type. I would be really careful changing the format in any way at this point, due to it's use, especially outside of npm (using the db.json file directly). Probably worth creating a new project at the point where the format of the main json needs to be changed. Remember that this library is just for looking up mime types; it does not provide any mechanism to lookup extensions. In this way, this library only provides information once you know the mime type, so it does not say that svgz is compressible, only that image/svg+xml is compressible and that there are two known extensions that mime type can have. The proposal won't for example solve the following data:
I think that we need to be really careful and not allow non-mime data creep into this module unless there is a clear discussion on exactly what this module will become and such. As it is, there isn't an issue here because the data refers to tge mime type, and as you admit the type is in fact compressible 👍 |
If you are wondering on the label, it is in reference to the subject (which is seen in lists along side labels):
Because this module does not mark anything about extensions, only mime types. If there is something using this module to infer such a thing, unfortunately that is outside this module's control. There is an open issue about providing extension-based data which would then make it an issue if that declared svgz as compressible but that functionality does not yet exist. |
And thinking it over more, I think shouldn't svgz extension not even be under that mime at all? I guess it would depend on if the specification for the image/svg+xml type has some kind of built in deflating? Just thinking if I compressed html and saved as htmz would that still be text/html ? |
https://www.w3.org/services/svg-server/ ... states .svgz and .svg are valid for |
Additional followup notes after rereading the spec of gzip, similar questions around the web related to ~"is svgz compressible?", and some of my experience/understanding: SummarizingIf a file is already compressed gzip will store it thus deactivating the compression and decompression algorithms and is a flat out "copy" (using 7z's terminology here) or "stored" as gzip typically refers to it. So the accumulated answer in short is a .svgz may be additionally compressible. Key points
From the standards, other answers over the years on the web, and my humble opinion/experience over the minuscule time I've been programming over the decades in relation to my mentors the issue of .svgz being compressible is negligible and should probably not be abstracted further here because not all use cases apply to current usage of a possible value of Regarding the extension usage instead of boolean for that json property of |
Currently
SVGZ
files are marked as compressible.mime-db/db.json
Lines 5866 to 5867 in 63731b4
This should not be the case as
SVGZ
files are basicallySVG
files compressed withgzip
, so they are already compressed.From https://www.w3.org/TR/SVG/intro.html#MIMEType:
The text was updated successfully, but these errors were encountered: