Use an LRU cache for guess_type

This commit is contained in:
Kovid Goyal 2024-09-17 10:08:07 +05:30
parent a700b3f19c
commit ade0f07eac
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -56,6 +56,7 @@ def _init_mimetypes():
_mt_inited = True
@lru_cache(4096)
def guess_type(*args, **kwargs):
import mimetypes
if not _mt_inited: