Forum OpenACS Development: Re: Caching: db_cache_pool vs. util_memoize
Use the db cache feature to cache query results, use ns_cache if you want to cache the result of something computed in Tcl.
The tricky bit with the db cache pool stuff is to construct a useful key for maintaining cache contents.
But that's true with util_memoize as well, cache coherency is a problem no matter what one does.
Additionally I am wondering, especially due to the cluster situation, if we should not have a wrapper for ns_cache, which allows us to flush the cache across the cluster if needed.
My assumption is that we will probably need a wrapper for ns_cache, which behaves similar to util_memoize with regards to clusters (and the flush-memoized-statement.tcl file), but offers more functionality and if it is only the name of the cache to use.
Last but not least I am wondering where we should provide the functionality to set the size of the caches? At the moment this is done in the Kernel parameters, so should each new cache have it's own setting there? How about default timeouts?