Comment 2 for bug 1076148

Revision history for this message
Samuel Merritt (torgomatic) wrote :

I looked at using deltas instead of absolute timestamps, and there's a problem. Specifically, the problem is that the memcache protocol has a suboptimal* design.

memcached differentiates between deltas and absolute timestamps by comparing them to an arbitrarily-chosen value** that's about 30 days. Anything over that is an absolute timestamp.

What this means for Swift is that you can't use deltas and have long-lived stuff in cache. Now, that's all abstract and hand-wavy, so here's two concrete examples:

TempAuth lets you set auth-token lifetimes to be as long as you want. If we used deltas, that would be limited to 30 days.

The cname middleware caches DNS lookups for the DNS TTL. If a domain owner sets a ridiculously long TTL on their domain, then the cname middleware would no longer cache lookups for it.

So, while it would be nice to use deltas instead of absolute timeout values, the memcached protocol is too limited* to let Swift do that without breaking a bunch of other stuff.

* stupid

** https://github.com/memcached/memcached/blob/master/memcached.c#L142