Use detect_media_type() with magic bytes instead of mimetypes.guess_type() which requires file extensions. Cache files are stored by content hash without extensions, so magic byte detection is needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>