Contents of locmem cache in Django?

前端 未结 1 495
难免孤独
难免孤独 2020-12-19 02:29

I was trying to use the locmem cache for my web application but couldn\'t find any documentation on how to see the contents of the cache. I mean I want to check if my keys

1条回答
  •  隐瞒了意图╮
    2020-12-19 03:15

    The thing about locmem is that it really is just a local memory storage. Looking at the code, it's clear that the data is just being saved in a module-level variable, _caches, in that module. So you can just do

    from django.core.cache.backends import locmem
    print(locmem._caches)
    

    0 讨论(0)
提交回复
热议问题