MINE types #236
JosePineiro
started this conversation in
Ideas
MINE types
#236
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
To fix the latest issue I have made PR #234, but this PR does not fix all potential issues with known extensions.
I suggest including MINE types for extensions that modern browsers can interpret/play. For files that can only be downloaded, including the MINE type provides no benefit, but adding it does increase the source code and worsens performance.
Embedded systems typically have limited flash storage (ESP32 commonly has 4MB). Therefore, I believe that it makes no sense to include low-compression formats that are very large in size when there are other, lighter formats with the same functionality.
I suggest including these formats:
HTML/HTM: Web interface files
CSS: Styling for web interfaces
JavaScript: Interactive functionality
JSON: Data exchange format
XML: Configuration and data files
TXT: Plain text files
CSV: Data logging and configuration
PNG: Icons, logos, screenshots (good compression, transparency)
JPEG/JPG: Photos, complex images (good compression)
SVG: Vector graphics, icons (scalable, tiny file sizes)
WebP: Modern format with superior compression
GIF: Simple animations, legacy support
ICO: Favicons, system icons. Legacy support
AVIF: Next-generation format for future-proofing
MP3: Universal compatibility, good compression
OGG: Open source, excellent compression
AAC: Modern codec, efficient compression
MP4: Universal compatibility, excellent compression
WebM: Open source, optimized for web
OGV: Ogg video container
WOFF: Universal browser support, good compression
WOFF2: Better compression, modern browser support
PDF: Universal document format
And exclude:
WAV: 30-40MB per song (vs 3-5MB for MP3)
FLAC: 15-25MB per song (lossless but impractical)
AVI: Large file sizes, poor web compatibility
MOV: Proprietary, large file sizes
M4A: Proprietary, compatibility issues
EOT: Internet Explorer only, deprecated
TTF: 50-150KB per font (vs 15-50KB for WOFF2)
OTF: Similar size issues as TTF
BMP: No compression, 10-50x larger than PNG
TIFF: Designed for print, not web, very large files
ZIP/GZ/RAR/7Z: Downloads files, doesn't display content
DOC/DOCX: Require Microsoft Office or compatible software
XLS/XLSX: Require Excel or compatible software
PPT/PPTX: Require PowerPoint or compatible software
C/CPP/H: Source code, displayed as plain text
PY/JAVA/PHP: Source code, no syntax highlighting
INI/CFG/CONF: Configuration files, displayed as plain text
M3U8: Playlist files, require specific media players
TS: Transport stream, require specific decoders
Currently, when a type isn't found, text/plain is sent. The most compatible is application/octet-stream. In all browsers, this causes the browser to download the text and not display it on the screen.
Note that I suggest adding formats that aren't there and removing others that are currently in the code. I suggest change the default MINE to application/octet-stream.
Please provide your comments.
Beta Was this translation helpful? Give feedback.
All reactions