Neeraj Sharma
Neeraj Sharma

Reputation: 1362

Python/Django Memcached keys expiration

I am using python/Django in my project with memcache. i just want to know what will happen if any of cache key get expired ? will the memory be free and ready to reuse?

Upvotes: 0

Views: 203

Answers (1)

emcconville
emcconville

Reputation: 24419

Checkout Memcached's wiki article NewUserInternals - No Guts No Glory. An item that expires will continue to set in memory until one of the following happens:

  • Client will attempt to fetch expired data. Memcached will see that it's expired, reclaim the memory, and not return the value to the client.
  • When a client request to store a new item, Memcached will check against Least Recently Used (LRU) for any expired items, and reclaim the memory.

Upvotes: 1

Related Questions