Open Chronial opened 7 years ago
I agree. In fact, caching will likely be slower than simply re-parsing the UA on each request. A warmed-up parser takes microseconds to parse the UA. See below:
No reason to put this extra burden on your cache server when it doesn't help you at all.
I'm also seeing some issues with redis parsing and ua-parser==0.15.0 as well. Haven't managed to pin it down yet though.
Caching the results seems unnecessary https://github.com/selwin/django-user_agents/blob/master/django_user_agents/utils.py#L41, since
uap-python
doesn't actually load the yamls anymore, but they are converted to python in the build process.See here https://github.com/ua-parser/uap-python/blob/master/setup.py#L20 and here https://github.com/ua-parser/uap-python/blob/master/ua_parser/user_agent_parser.py#L548.
So this is loaded and imported once and then cached by the python importing system anyways.