Using 0 never works out very well in the end. You will always run into things that QA didn't catch when trying to invalidate keys. Especially when the same key is accessed in many different parts of your code base. If you have a solid code base that almost never changes, sure you could get away with a 0 TTL.

On Apr 16, 2009, at 1:20 PM, Dustin wrote:



On Apr 16, 11:43 am, Chris Peterson <[email protected]> wrote:
Are there documented best practices for setting expiration times for
cached items?

I'm also curious about the distribution of expiration times used by
large users of memcached. Are there any metrics for the common
percentages of cached items:

* with no expiration time?
* expiring within seconds?
* expiring within minutes?
* expiring within hours?
* expiring within days?

 It depends on your needs.  For a normal item cache situation, it
seems that anything other than 0 is just a lack of confidence in your
invalidation logic or perhaps a hint that something is no longer
interesting after a particular point in time so the server may as well
get rid of it sooner if it has the opportunity.

Reply via email to