Forum OpenACS Q&A: Re: Serverside Caching for time consuming pages/packages

Collapse
Posted by Dave Bauer on
You'll need two tcl procedures:

my_proc_not_cached

and

my_proc

my_proc will call [util_memoize my_proc_not_cached args]

and your code will always call my_proc.

You can optionally pass in the max_age for the item if you want it to expire.

There will be a seperate cache item for each unique call to my_proc_not_cached so that calls with different arguments are cached seperately. You can flush the cache for each cache key by calling util_memoize_flush my_proc_not_cached args.