django-oscar
django-oscar copied to clipboard
Basket middleware takes a long time
Issue Summary
We profile oscar's home page loading with a profiling tool PyLive. And we find in src/oscar/apps/basket/middleware.py, BasketMiddleware.call unexpectedly takes a long time, summing up to over 90% of the total time. And things are the same for product page and even search result page.
So we wonder if there is anything slow down in this basket middleware.
Steps to Reproduce
- Profile functions in oscar
- Load the main page and get the profiling result, you will see BasketMiddleware.call takes up a lot of percentage.
Technical details
- Python version: 3.6.9
- Django version: 2.2.12
- Oscar version: 2.0
Likely duplicate of #1329