First time here? Check out the FAQ!
2

How do I check if memcache is working?

I recently set up memcache. How do I check that it is working correctly?

Joseph's avatar
353
Joseph
asked 2012-07-24 23:24:09 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

Log in to django's shell:

python manage.py shell

and type:

from django.core.cache import cache
cache.set('somekey', 'someval')
cache.get('somekey')

You should get back 'someval' when the cache works. You can confirm that with the dummy cache backend the cache.get('somekey') will return None, but with some real backend you'll get the stored value.

Evgeny's avatar
13.2k
Evgeny
answered 2012-07-26 21:16:34 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments