Get expiration time of a memcache item in php?
Posted
by Jonatan Littke
on Stack Overflow
See other posts from Stack Overflow
or by Jonatan Littke
Published on 2010-03-15T08:01:57Z
Indexed on
2010/03/15
8:09 UTC
Read the original article
Hit count: 255
Hey.
I'm caching tweets on my site (with 30 min expiration time). When the cache is empty, the first user to find out will repopulate it.
However, at that time the Twitter API may return a 200. In that case I'd like to prolong the previous data for another 30 mins. But the previous data will already be lost.
So instead I'd like to look into repopulating the cache, say, 5 minutes before expiration time so that I don't lose any date.
So how do I know the expiration time of an item when using php's memcache::get()?
Also, is there a better way of doing this?
© Stack Overflow or respective owner