I see some discussion from back in 2008 on the subject, but hoping
something might have changed.

Is there any way that I can cache a select, and then on update,
automatically remove any cached selects on this table/field?

I see that I can remove cache for a specific query like this:
cache.ram(db._uri+'/'+db(....)._select(....),None,0)
or clear all cached selects like this: cache.ram.clear(db._uri + '/
SELECT')
but I'm doing updates to a particular row, and all sorts of selects on
that table that have many types of different select statements (and
return data in that row). Is there a way that I can cache the select,
and then either remove the cache for any select statements that target
that row, or even (more intensive, but possibly doable) remove all
selects that are cached for that table?

Seems (from the outside looking in) that this should somehow be part
of the update statement. Something like:

db(...).update(..., cache=(cache.ram, 3600))

of course this should also work on:

db(...).select(..., cache=(cache.ram,
3600)).first().update_record(...)

but I don't find any info on that in slices, book, or this mailing
list.

Feedback? Questions? Flames? Answers? All accepted.

Reply via email to