Where can I find a list of textual MIME types?
I want to make a list of MIME Types which can be compressed by gzip. The first obvious ones to includes are those which begin with "text/". Beyond that I can only add the ones off the top of my head which I know are textual, like "application/json".
Is there a list, canonical or otherwise, that I can refer to?
IANA manages the official list of Media Types
But to know which ones are textual, you'd need to consult RFCs in which they were proposed.
Here is Perl's list. Seems too small...
Maybe better is to make a list of types to not try to compress with gzip. Those would be the types that you know are already compressed. In particular, image, video, and audio types.
It is better to be inclusive than exclusive, since compressing something already compressed only impacts CPU time on the server, and has a vanishingly small effect on bandwidth. On the other hand not compressing something that can be compressed could have a big effect on bandwidth and therefore user experience. Many types could be added that aren't on your list. You'll totally miss the benefit of compressing those with a whitelist. Better to compress what you don't know about, and only not compress what you know for sure is already compressed.