Ask Your Question
2

How do I check if memcache is working?

asked 2012-07-24 23:24:09 -0500

Joseph gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-07-26 21:16:34 -0500

Evgeny gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2012-07-24 23:24:09 -0500

Seen: 2,247 times

Last updated: Jul 26 '12