The mime type is always the value passed in. Compress or not depends on the content detection, file name extension, and compression ratio. If the content is already compressed, need to know the content size.