How can I test if my redis cache is working?

前端 未结 3 598
时光取名叫无心
时光取名叫无心 2021-02-02 14:54

I\'ve installed django-redis-cache and redis-py. I\'ve followed the caching docs for Django. As far as I know, the settings below are all that I need. But how do I tell if it\'s

3条回答
  •  一向
    一向 (楼主)
    2021-02-02 15:10

    You could install the django-debug-toolbar and see if the number of queries decreases when you enable caching. Though I don't think this is the best solution to the posed question, I still think you want to do this, as you can easily pinpoint costly queries using this setup, and then add the appropriate caching to them.

提交回复
热议问题