I am trying to improve my Fat Free Framework web app by using cached queries, wherever possibile.
I am wondering whether it would make any sense to try caching even queries involving data which changes quite ofter or so, by applying a little 'trick'.
IE, tipically you wouldn't cache this:
SELECT * FROM tasks WHERE status = 'open';
But what if I could instead cache it indefinitely and have external factors clear its cache when a specific event (e.g. a task is closed, in this case) occurs?
If this is my query:
$tasks = $this->db->exec(
array(
"SELECT *
FROM tasks
WHERE status = 'open'"
),
NULL,
86400
);
is there any possible way by which I can force its 24h-long cached version to expire earlier?