I'm a bit confused on memcached and PHP when used with SQL queries.
Practically every guide I've come across does something resembling this:
$querykey = "KEY" . md5($query);
$result = $mem->get($querykey);
What I don't understand, is why they all seem to store a hashed version of the actual query as the key?
Wouldn't it be better to give it a proper name, that way it's easier to reference anywhere in your script and invalidate it if needed?
Like this guide and this guide.