Ask Your Question
1

How do I check if memcache is working?

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

Joseph gravatar image Joseph
303 12 4 19

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

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

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

Evgeny gravatar image Evgeny flag of Chile
11329 50 84 183
http://askbot.org/

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.

link publish delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Reliable Askbot Hosting

Create your Q&A site at askbot.com. Managed Askbot hosting at just $15/mo. Dedicated hosting, support contracts, consulting services.

create your Q&A site
30 days free trial

Question tools

Follow
1 follower

subscribe to rss feed

Stats

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

Seen: 268 times

Last updated: Jul 26 '12