I understand the need for a function like DB_Get_Cached("sql string") that hashes the SQL in order to perform a lookup in memcached for the existence of the data.
function DB_Get_Cached(string SQL)
data = memcache_get_data(md5(SQL))
if (!data)
return DB_Get(SQL)
end if
end function
What is a good method to expand this to handle data invalidation or timeout?
I'm thinking in terms of product pages in an e-commerce site, or user details in their profile.
Thanks