Index: openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl 5 Aug 2018 21:08:42 -0000 1.8 +++ openacs-4/packages/acs-tcl/tcl/memoize-procs-naviserver.tcl 11 Feb 2019 10:11:45 -0000 1.9 @@ -53,10 +53,19 @@ @return The possibly-cached value returned by script. } { - if {$max_age ne ""} { - set max_age "-expires $max_age" + # + # The ::util_memoize_flush proc is defined in the *-init script, + # after the util_memoize cache was created. Therefore is save to + # use the util_memoize when this proc is available. + # + if {[info commands ::util_memoize_flush] ne ""} { + if {$max_age ne ""} { + set max_age "-expires $max_age" + } + ns_cache_eval {*}$max_age -- util_memoize $script {*}$script + } else { + uplevel $script } - ns_cache_eval {*}$max_age -- util_memoize $script {*}$script } # In case, the definition of the function has cached something,