Forum OpenACS Q&A: Re: How do I cache a big database request?

Collapse
Posted by Dave Bauer on
You can wrap the query in a tcl proc that takes the criteria for the query as parameters. You can util_memoize the call to that tcl proc. For example, from ETP:
    set code "etp::get_pa [ad_conn package_id] $name $content_type"
    array set pa [util_memoize $code $max_age]
This memoizes the attributes of an ETP page. Its from the etp::get_page_attributes proc.